mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 16:43:11 +01:00
Clear last attributes after reset in string_cells, from George Nachman.
This commit is contained in:
parent
1e20153b6e
commit
e487b87f6f
7
grid.c
7
grid.c
@ -511,6 +511,7 @@ grid_string_cells_code(const struct grid_cell *lastgc,
|
|||||||
for (i = 0; i < nitems(attrs); i++) {
|
for (i = 0; i < nitems(attrs); i++) {
|
||||||
if (!(attr & attrs[i].mask) && (lastattr & attrs[i].mask)) {
|
if (!(attr & attrs[i].mask) && (lastattr & attrs[i].mask)) {
|
||||||
s[n++] = 0;
|
s[n++] = 0;
|
||||||
|
lastattr &= GRID_ATTR_CHARSET;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -523,7 +524,8 @@ grid_string_cells_code(const struct grid_cell *lastgc,
|
|||||||
/* If the foreground c changed, append its parameters. */
|
/* If the foreground c changed, append its parameters. */
|
||||||
nnewc = grid_string_cells_fg(gc, newc);
|
nnewc = grid_string_cells_fg(gc, newc);
|
||||||
noldc = grid_string_cells_fg(lastgc, oldc);
|
noldc = grid_string_cells_fg(lastgc, oldc);
|
||||||
if (nnewc != noldc || memcmp(newc, oldc, nnewc * sizeof newc[0]) != 0) {
|
if (nnewc != noldc ||
|
||||||
|
memcmp(newc,oldc, nnewc * sizeof newc[0]) != 0) {
|
||||||
for (i = 0; i < nnewc; i++)
|
for (i = 0; i < nnewc; i++)
|
||||||
s[n++] = newc[i];
|
s[n++] = newc[i];
|
||||||
}
|
}
|
||||||
@ -531,7 +533,8 @@ grid_string_cells_code(const struct grid_cell *lastgc,
|
|||||||
/* If the background c changed, append its parameters. */
|
/* If the background c changed, append its parameters. */
|
||||||
nnewc = grid_string_cells_bg(gc, newc);
|
nnewc = grid_string_cells_bg(gc, newc);
|
||||||
noldc = grid_string_cells_bg(lastgc, oldc);
|
noldc = grid_string_cells_bg(lastgc, oldc);
|
||||||
if (nnewc != noldc || memcmp(newc, oldc, nnewc * sizeof newc[0]) != 0) {
|
if (nnewc != noldc ||
|
||||||
|
memcmp(newc, oldc, nnewc * sizeof newc[0]) != 0) {
|
||||||
for (i = 0; i < nnewc; i++)
|
for (i = 0; i < nnewc; i++)
|
||||||
s[n++] = newc[i];
|
s[n++] = newc[i];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user