mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00
terminal: only clear wide spacer head if wide char is not on first line
This commit is contained in:
@ -672,7 +672,7 @@ fn printCell(self: *Terminal, unmapped_c: u21) *Screen.Cell {
|
|||||||
const spacer_cell = row.getCellPtr(x);
|
const spacer_cell = row.getCellPtr(x);
|
||||||
spacer_cell.attrs.wide_spacer_tail = false;
|
spacer_cell.attrs.wide_spacer_tail = false;
|
||||||
|
|
||||||
if (self.screen.cursor.x <= 1) {
|
if (self.screen.cursor.y > 0 and self.screen.cursor.x <= 1) {
|
||||||
self.clearWideSpacerHead();
|
self.clearWideSpacerHead();
|
||||||
}
|
}
|
||||||
} else if (cell.attrs.wide_spacer_tail) {
|
} else if (cell.attrs.wide_spacer_tail) {
|
||||||
@ -1415,6 +1415,18 @@ test "Terminal: zero-width character at start" {
|
|||||||
try testing.expectEqual(@as(usize, 0), t.screen.cursor.x);
|
try testing.expectEqual(@as(usize, 0), t.screen.cursor.x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "Terminal: print over wide char at 0,0" {
|
||||||
|
var t = try init(testing.allocator, 80, 80);
|
||||||
|
defer t.deinit(testing.allocator);
|
||||||
|
|
||||||
|
try t.print(0x1F600); // Smiley face
|
||||||
|
t.setCursorPos(0, 0);
|
||||||
|
try t.print('A'); // Smiley face
|
||||||
|
|
||||||
|
try testing.expectEqual(@as(usize, 0), t.screen.cursor.y);
|
||||||
|
try testing.expectEqual(@as(usize, 1), t.screen.cursor.x);
|
||||||
|
}
|
||||||
|
|
||||||
test "Terminal: soft wrap" {
|
test "Terminal: soft wrap" {
|
||||||
var t = try init(testing.allocator, 3, 80);
|
var t = try init(testing.allocator, 3, 80);
|
||||||
defer t.deinit(testing.allocator);
|
defer t.deinit(testing.allocator);
|
||||||
|
Reference in New Issue
Block a user