From 2583b8cb655f04fb87c9249971dbd4c29de35bc7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 3 Sep 2022 12:25:26 -0700 Subject: [PATCH] fix y pos on resize --- src/terminal/Screen.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index 2153d348c..53261bb57 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -849,7 +849,7 @@ pub fn resizeWithoutReflow(self: *Screen, rows: usize, cols: usize) !void { // the same scrollback. const old_cursor_y_screen = RowIndexTag.active.index(old.cursor.y).toScreen(&old).screen; self.cursor.x = @minimum(old.cursor.x, self.cols - 1); - self.cursor.y = if (old_cursor_y_screen < RowIndexTag.screen.maxLen(self)) + self.cursor.y = if (old_cursor_y_screen <= RowIndexTag.screen.maxLen(self)) old_cursor_y_screen - self.history else self.rows - 1;