diff options
author | notomo <notomo.motono@gmail.com> | 2021-08-23 07:27:20 +0900 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-16 14:44:59 +0100 |
commit | 6bda2f56eb01b9a9ee3c0d25cb607d03dd64b91a (patch) | |
tree | fffb4f1e7afaa43fe0b5d0f46c2507fd8a385958 /src | |
parent | be58ba250ee253892ae5c80e89d9a372e89460dc (diff) | |
download | rneovim-6bda2f56eb01b9a9ee3c0d25cb607d03dd64b91a.tar.gz rneovim-6bda2f56eb01b9a9ee3c0d25cb607d03dd64b91a.tar.bz2 rneovim-6bda2f56eb01b9a9ee3c0d25cb607d03dd64b91a.zip |
backport: 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 4c965d3bd8..472a52e113 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -2702,7 +2702,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; |