From d551f1126bb90181bbd960c75d401821ad7c814e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 8 Aug 2022 17:44:13 -0700 Subject: [PATCH] when less cols, cursor needs to be in screen space, not viewport --- src/terminal/Screen.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index 84f299b4b..a182ef124 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -745,7 +745,7 @@ pub fn resize(self: *Screen, alloc: Allocator, rows: usize, cols: usize) !void { cursor_pos.x == i) { assert(new_cursor == null); - new_cursor = .{ .x = x, .y = y }; + new_cursor = .{ .x = x, .y = self.visible_offset + y }; } // Copy the old cell, unset the old wrap state @@ -766,7 +766,7 @@ pub fn resize(self: *Screen, alloc: Allocator, rows: usize, cols: usize) !void { assert(new_cursor == null); new_cursor = .{ .x = @minimum(cursor_pos.x, self.cols - 1), - .y = y, + .y = self.visible_offset + y, }; }