Instantly share code, notes, and snippets.

anonymous /gist:0cb17b6e86fdff3b49a2 Secret
Created Sep 17, 2014

Embed
What would you like to do?
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