aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro+github@gmail.com>2019-03-23 00:23:39 +0100
committerGitHub <noreply@github.com>2019-03-23 00:23:39 +0100
commit3e78319ac608abadd5204e00295dc3ace7e2edd8 (patch)
tree59362c15a8559c78a4bf9c0b3b833c684959bb7d /src
parent3edf7fc64f6735a283af2c6cf728b28179bcb582 (diff)
downloadrneovim-3e78319ac608abadd5204e00295dc3ace7e2edd8.tar.gz
rneovim-3e78319ac608abadd5204e00295dc3ace7e2edd8.tar.bz2
rneovim-3e78319ac608abadd5204e00295dc3ace7e2edd8.zip
help: ignore snapshotted window if invalid (#9774)
Nvim doesn't expect a window-changing command on an created-window event. autocmd WinNew * wincmd p help help - A snapshot for window 1000 is created. - The window is split and the cursor changes to the new window 1001. - The autocmd kicks in and switches back to 1000. - The help buffer is opened. - On closing the help window 1000, it tries to go back to the snapshotted window which is... 1000. - wp1000->w_buffer == NULL - w_buffer is used by check_cursor() - 🧨 -> 💥 Fixes https://github.com/neovim/neovim/issues/9773
Diffstat (limited to 'src')
-rw-r--r--src/nvim/window.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index e60cfbfb92..f9a0839702 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -6062,7 +6062,7 @@ static win_T *get_snapshot_focus(int idx)
}
}
- return sn->fr_win;
+ return win_valid(sn->fr_win) ? sn->fr_win : NULL;
}
/*