widgets(terminal): fix eraseLeft

This commit is contained in:
Tim Culverhouse 2024-06-10 09:18:31 -05:00
parent 0cd57fe0f5
commit e4005253d2
2 changed files with 4 additions and 5 deletions

View file

@ -371,7 +371,7 @@ pub fn eraseRight(self: *Screen) void {
pub fn eraseLeft(self: *Screen) void {
self.cursor.pending_wrap = false;
const start = self.cursor.row * self.width;
const end = start + self.cursor.col;
const end = start + self.cursor.col + 1;
var i = start;
while (i < end) : (i += 1) {
self.buf[i].erase(self.cursor.style.bg);

View file

@ -306,7 +306,7 @@ fn run(self: *Terminal) !void {
self.back_screen.cursorUp(delta);
self.carriageReturn();
},
// Horizontal Positional Absolute
// Horizontal Position Absolute
'G', '`' => {
var iter = seq.iterator(u16);
const col = iter.next() orelse 1;
@ -401,7 +401,7 @@ fn run(self: *Terminal) !void {
self.back_screen.cursor.row = self.back_screen.scrolling_region.top;
try self.back_screen.insertLine(n);
},
'W' => {}, // TODO: Tab control
// 'W' => {}, // TODO: Tab control
'X' => {
self.back_screen.cursor.pending_wrap = false;
var iter = seq.iterator(u16);
@ -416,8 +416,7 @@ fn run(self: *Terminal) !void {
self.back_screen.buf[i].erase(self.back_screen.cursor.style.bg);
}
},
'Z' => {}, // TODO: Back tab
//
// 'Z' => {}, // TODO: Back tab
// Cursor Vertial Position Aboslute
'd' => {
var iter = seq.iterator(u16);