diff options
author | Sean Dewar <6256228+seandewar@users.noreply.github.com> | 2024-03-09 16:56:32 +0000 |
---|---|---|
committer | Sean Dewar <6256228+seandewar@users.noreply.github.com> | 2024-03-09 18:00:30 +0000 |
commit | b52d15853e89149472c1ecd9cce3a84e4af0785a (patch) | |
tree | dd13e54f31d20bff698a209af0af2424b75e4617 /src/nvim/window.c | |
parent | 33dfb5a383d7afacda35b8fd392ad18d57db2870 (diff) | |
download | rneovim-b52d15853e89149472c1ecd9cce3a84e4af0785a.tar.gz rneovim-b52d15853e89149472c1ecd9cce3a84e4af0785a.tar.bz2 rneovim-b52d15853e89149472c1ecd9cce3a84e4af0785a.zip |
fix(api): win_set_config set tp_curwin of win moved from other tabpage
Problem: nvim_win_set_config does not update the tp_curwin of win's original
tabpage when moving it to another.
Solution: update it if win was the tp_curwin. Add a test.
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r-- | src/nvim/window.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index 4dc6ed370e..ecd2e83500 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -3044,20 +3044,7 @@ static win_T *win_free_mem(win_T *win, int *dirp, tabpage_T *tp) xfree(frp); } else { *dirp = 'h'; // Dummy value. - if (tp == NULL) { - if (win_valid(prevwin) && prevwin != win) { - wp = prevwin; - } else { - wp = firstwin; - } - } else { - assert(tp != curtab); - if (tabpage_win_valid(tp, tp->tp_prevwin) && tp->tp_prevwin != win) { - wp = tp->tp_prevwin; - } else { - wp = tp->tp_firstwin; - } - } + wp = win_float_find_altwin(win, tp); } win_free(win, tp); |