summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-12-12 13:47:44 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-12 13:47:44 +0000
commit67578e5bcf7404d40d42876b738b72e68add1a3e (patch)
tree44dee70a2c31407a979037d8127115c11dacc680
parentb7acea1806996a9afb9fb8ebfe571b5181063070 (diff)
downloadvim-git-67578e5bcf7404d40d42876b738b72e68add1a3e.tar.gz
patch 9.0.1049: crash when opening a very small terminal windowv9.0.1049
Problem: Crash when opening a very small terminal window. Solution: Instead of crashing fix the cursor position. (closes #11697)
-rw-r--r--src/libvterm/src/screen.c10
-rw-r--r--src/version.c2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/libvterm/src/screen.c b/src/libvterm/src/screen.c
index 069306ab9..fb1d26e43 100644
--- a/src/libvterm/src/screen.c
+++ b/src/libvterm/src/screen.c
@@ -661,9 +661,15 @@ static void resize_buffer(VTermScreen *screen, int bufidx, int new_rows, int new
}
/* We really expect the cursor position to be set by now */
+ /* Unfortunately we do get here when "new_rows" is one. We don't want
+ * to crash, so until the above code is fixed let's just set the cursor. */
if(active && (new_cursor.row == -1 || new_cursor.col == -1)) {
- fprintf(stderr, "screen_resize failed to update cursor position\n");
- abort();
+ /* fprintf(stderr, "screen_resize failed to update cursor position\n");
+ * abort(); */
+ if (new_cursor.row < 0)
+ new_cursor.row = 0;
+ if (new_cursor.col < 0)
+ new_cursor.col = 0;
}
if(old_row >= 0 && bufidx == BUFIDX_PRIMARY) {
diff --git a/src/version.c b/src/version.c
index ad9e52b2e..48d9250cb 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1049,
+/**/
1048,
/**/
1047,