Skip to content

Instantly share code, notes, and snippets.

Created September 17, 2014 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/0cb17b6e86fdff3b49a2 to your computer and use it in GitHub Desktop.
Save anonymous/0cb17b6e86fdff3b49a2 to your computer and use it in GitHub Desktop.
diff --git a/grid.c b/grid.c
index a84a58b..c0082ce 100644
--- a/grid.c
+++ b/grid.c
@@ -505,6 +505,13 @@ grid_string_cells_code(const struct grid_cell *lastgc,
if (!(attr & attrs[i].mask) && (lastattr & attrs[i].mask)) {
s[n++] = 0;
lastattr &= GRID_ATTR_CHARSET;
+ /* Don't lose the set colours on attr reset */
+ noldc = grid_string_cells_fg(lastgc, oldc);
+ for (i = 0; i < noldc; i++)
+ s[n++] = oldc[i];
+ noldc = grid_string_cells_bg(lastgc, oldc);
+ for (i = 0; i < noldc; i++)
+ s[n++] = oldc[i];
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment