mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 9.0.1049: crash when opening a very small terminal window
Problem: Crash when opening a very small terminal window. Solution: Instead of crashing fix the cursor position. (closes #11697)
This commit is contained in:
parent
b7acea1806
commit
67578e5bcf
@ -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 */
|
/* 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)) {
|
if(active && (new_cursor.row == -1 || new_cursor.col == -1)) {
|
||||||
fprintf(stderr, "screen_resize failed to update cursor position\n");
|
/* fprintf(stderr, "screen_resize failed to update cursor position\n");
|
||||||
abort();
|
* 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) {
|
if(old_row >= 0 && bufidx == BUFIDX_PRIMARY) {
|
||||||
|
@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1049,
|
||||||
/**/
|
/**/
|
||||||
1048,
|
1048,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user