terminal: when clearing previous wide character, preserve SGR state

This commit is contained in:
Mitchell Hashimoto
2023-10-13 15:15:14 -07:00
parent 8fe722686d
commit 529d1f016f

View File

@ -811,7 +811,7 @@ fn printCell(self: *Terminal, unmapped_c: u21) *Screen.Cell {
assert(x < self.cols); assert(x < self.cols);
const spacer_cell = row.getCellPtr(x); const spacer_cell = row.getCellPtr(x);
spacer_cell.attrs.wide_spacer_tail = false; spacer_cell.* = self.screen.cursor.pen;
if (self.screen.cursor.y > 0 and self.screen.cursor.x <= 1) { if (self.screen.cursor.y > 0 and self.screen.cursor.x <= 1) {
self.clearWideSpacerHead(); self.clearWideSpacerHead();
@ -821,8 +821,7 @@ fn printCell(self: *Terminal, unmapped_c: u21) *Screen.Cell {
const x = self.screen.cursor.x - 1; const x = self.screen.cursor.x - 1;
const wide_cell = row.getCellPtr(x); const wide_cell = row.getCellPtr(x);
wide_cell.char = 0; wide_cell.* = self.screen.cursor.pen;
wide_cell.attrs.wide = false;
if (self.screen.cursor.y > 0 and self.screen.cursor.x <= 1) { if (self.screen.cursor.y > 0 and self.screen.cursor.x <= 1) {
self.clearWideSpacerHead(); self.clearWideSpacerHead();