diff options
author | notomo <notomo.motono@gmail.com> | 2021-08-23 07:27:20 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-22 15:27:20 -0700 |
commit | 90b2da16ae1aadc070183a0eeb237dddd0cd21b8 (patch) | |
tree | cb1f2837420ec01b08262ac581221d9d1431f08a /src | |
parent | da5d023c97d7e156bc9e264cc9d8a9f473b9bba6 (diff) | |
download | rneovim-90b2da16ae1aadc070183a0eeb237dddd0cd21b8.tar.gz rneovim-90b2da16ae1aadc070183a0eeb237dddd0cd21b8.tar.bz2 rneovim-90b2da16ae1aadc070183a0eeb237dddd0cd21b8.zip |
fix(window.c): win_close from other tabpage #15454
Fix #15313
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/window.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index f0faeac2d7..eddbe14da2 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -2709,7 +2709,11 @@ static win_T *win_free_mem( // When deleting the current window of another tab page select a new // current window. if (tp != NULL && win == tp->tp_curwin) { - tp->tp_curwin = wp; + if (win_valid(tp->tp_prevwin) && tp->tp_prevwin != win) { + tp->tp_curwin = tp->tp_prevwin; + } else { + tp->tp_curwin = tp->tp_firstwin; + } } return wp; |