diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-02-12 21:48:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-12 21:48:20 +0800 |
commit | 7db0aa027cff8da11a3fe2c26267a059f35297d7 (patch) | |
tree | e75488c667ccca84801bbc0cc79c6bde518b994c /src/nvim/window.c | |
parent | a1f34b248106619f861dcc186c1adf8053f572d7 (diff) | |
parent | c23ec9d86e41e9dd03ab33ef8a80640e1366c476 (diff) | |
download | rneovim-7db0aa027cff8da11a3fe2c26267a059f35297d7.tar.gz rneovim-7db0aa027cff8da11a3fe2c26267a059f35297d7.tar.bz2 rneovim-7db0aa027cff8da11a3fe2c26267a059f35297d7.zip |
Merge pull request #17381 from zeertzjq/vim-8.2.0580
vim-patch:8.2.0580: window size wrong if 'ea' is off and 'splitright' is on
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r-- | src/nvim/window.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index 4861b71995..e09af7a7bb 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -3079,9 +3079,21 @@ static frame_T *win_altframe(win_T *win, tabpage_T *tp) return frp->fr_prev; } + // By default the next window will get the space that was abandoned by this + // window frame_T *target_fr = frp->fr_next; frame_T *other_fr = frp->fr_prev; - if (p_spr || p_sb) { + + // If this is part of a column of windows and 'splitbelow' is true then the + // previous window will get the space. + if (frp->fr_parent != NULL && frp->fr_parent->fr_layout == FR_COL && p_sb) { + target_fr = frp->fr_prev; + other_fr = frp->fr_next; + } + + // If this is part of a row of windows, and 'splitright' is true then the + // previous window will get the space. + if (frp->fr_parent != NULL && frp->fr_parent->fr_layout == FR_ROW && p_spr) { target_fr = frp->fr_prev; other_fr = frp->fr_next; } |