mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.1.1264: crash when closing window from WinBar click
Problem: Crash when closing window from WinBar click. (Ben Jackson) Solution: Check that window pointer is still valid. (closes #4337)
This commit is contained in:
@@ -2506,9 +2506,10 @@ winbar_click(win_T *wp, int col)
|
||||
check_cursor();
|
||||
}
|
||||
|
||||
// Note: the command might close the current window.
|
||||
execute_menu(NULL, item->wb_menu, -1);
|
||||
|
||||
if (save_curwin != NULL)
|
||||
if (save_curwin != NULL && win_valid(save_curwin))
|
||||
{
|
||||
curwin = save_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
@@ -2518,6 +2519,8 @@ winbar_click(win_T *wp, int col)
|
||||
VIsual_reselect = save_visual_reselect;
|
||||
VIsual_mode = save_visual_mode;
|
||||
}
|
||||
if (!win_valid(wp))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -767,6 +767,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1264,
|
||||
/**/
|
||||
1263,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user