mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
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.
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user