From e4005253d2c4a8e5de715821f97d00a2423dd2bc Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Mon, 10 Jun 2024 09:18:31 -0500 Subject: [PATCH] widgets(terminal): fix eraseLeft --- src/widgets/terminal/Screen.zig | 2 +- src/widgets/terminal/Terminal.zig | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/widgets/terminal/Screen.zig b/src/widgets/terminal/Screen.zig index 267a5b4..052e8b4 100644 --- a/src/widgets/terminal/Screen.zig +++ b/src/widgets/terminal/Screen.zig @@ -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); diff --git a/src/widgets/terminal/Terminal.zig b/src/widgets/terminal/Terminal.zig index bd3a8f5..502c6b1 100644 --- a/src/widgets/terminal/Terminal.zig +++ b/src/widgets/terminal/Terminal.zig @@ -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);