mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
erase display above
This commit is contained in:
@ -284,6 +284,27 @@ pub fn eraseDisplay(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
.above => {
|
||||||
|
// Erase to the left (including the cursor)
|
||||||
|
var x: usize = 0;
|
||||||
|
while (x <= self.cursor.x) : (x += 1) {
|
||||||
|
const cell = try self.getOrPutCell(alloc, x, self.cursor.y);
|
||||||
|
cell.* = self.cursor.pen;
|
||||||
|
cell.char = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// All lines above
|
||||||
|
var y: usize = 0;
|
||||||
|
while (y < self.cursor.y) : (y += 1) {
|
||||||
|
x = 0;
|
||||||
|
while (x < self.cols) : (x += 1) {
|
||||||
|
const cell = try self.getOrPutCell(alloc, x, y);
|
||||||
|
cell.* = self.cursor.pen;
|
||||||
|
cell.char = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
else => {
|
else => {
|
||||||
log.err("unimplemented display mode: {}", .{mode});
|
log.err("unimplemented display mode: {}", .{mode});
|
||||||
@panic("unimplemented");
|
@panic("unimplemented");
|
||||||
|
Reference in New Issue
Block a user