hook up delete lines

This commit is contained in:
Mitchell Hashimoto
2022-05-11 17:55:28 -07:00
parent 8a0d7a3494
commit b528208dfd
2 changed files with 12 additions and 0 deletions

View File

@ -561,6 +561,10 @@ pub fn eraseChars(self: *Window, count: usize) !void {
try self.terminal.eraseChars(count);
}
pub fn deleteLines(self: *Window, count: usize) !void {
self.terminal.deleteLines(self.alloc, count);
}
pub fn reverseIndex(self: *Window) !void {
try self.terminal.reverseIndex(self.alloc);
}

View File

@ -194,6 +194,14 @@ pub fn Stream(comptime Handler: type) type {
},
) else log.warn("unimplemented CSI callback: {}", .{action}),
// DL - Delete Lines
// TODO: test
'M' => if (@hasDecl(T, "deleteLines")) switch (action.params.len) {
0 => try self.handler.deleteLines(1),
1 => try self.handler.deleteLines(action.params[0]),
else => log.warn("invalid DL command: {}", .{action}),
} else log.warn("unimplemented CSI callback: {}", .{action}),
// Delete Character (DCH)
'P' => if (@hasDecl(T, "deleteChars")) try self.handler.deleteChars(
switch (action.params.len) {