mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 08:48:16 +00:00
Make sure window is still valid in the middle of calling :lopen (#14240)
Make sure that oldwin is not invalid after splitting Revisit this when porting vim patch v8.1.0892 and related quickfix patches.
This commit is contained in:
@@ -3617,6 +3617,15 @@ static int qf_open_new_cwindow(qf_info_T *qi, int height)
|
||||
if (win_split(height, flags) == FAIL) {
|
||||
return FAIL; // not enough room for window
|
||||
}
|
||||
|
||||
// User autocommands may have invalidated the previous window after calling
|
||||
// win_split, so add a check to ensure that the win is still here
|
||||
if (IS_LL_STACK(qi) && !win_valid(win)) {
|
||||
// close the window that was supposed to be for the loclist
|
||||
win_close(curwin, false);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
RESET_BINDING(curwin);
|
||||
|
||||
if (IS_LL_STACK(qi)) {
|
||||
|
Reference in New Issue
Block a user