From c28c0ab9c2c9a36d20356392fafbf6588abaeb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 12 Feb 2020 19:49:39 +0100 Subject: [PATCH] render: resize: only stay on current row if col is within grid width --- render.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/render.c b/render.c index 45fe6a6a..e854b6b0 100644 --- a/render.c +++ b/render.c @@ -1227,7 +1227,9 @@ maybe_resize(struct terminal *term, int width, int height, bool force) while (cursor_row < 0) cursor_row += term->grid->num_rows; - cursor_row--; + + if (term->cursor.point.col < term->cols - 1) + cursor_row--; assert(cursor_row < term->rows); term_cursor_to(