mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 22:08:18 +00:00
window: don't crash when closing two floats in a row
prevwin can be set to the current window. Then we can't jump to it after closing a float.
This commit is contained in:
@@ -2313,10 +2313,10 @@ int win_close(win_T *win, bool free_buf)
|
||||
if (!win->w_floating) {
|
||||
wp = frame2win(win_altframe(win, NULL));
|
||||
} else {
|
||||
if (win_valid(prevwin)) {
|
||||
if (win_valid(prevwin) && prevwin != win) {
|
||||
wp = prevwin;
|
||||
} else {
|
||||
wp = curtab->tp_firstwin;
|
||||
wp = firstwin;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2595,10 +2595,10 @@ win_free_mem (
|
||||
wp = winframe_remove(win, dirp, tp);
|
||||
xfree(frp);
|
||||
} else {
|
||||
if (win_valid(prevwin)) {
|
||||
if (win_valid(prevwin) && prevwin != win) {
|
||||
wp = prevwin;
|
||||
} else {
|
||||
wp = curtab->tp_firstwin;
|
||||
wp = firstwin;
|
||||
}
|
||||
}
|
||||
win_free(win, tp);
|
||||
|
Reference in New Issue
Block a user