mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 08:16:13 +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);
|
||||
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();
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
|
||||
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" {
|
||||
var t = try init(testing.allocator, 3, 80);
|
||||
defer t.deinit(testing.allocator);
|
||||
|
Reference in New Issue
Block a user