neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 77d9c672f82d260dc5421519a2f78ed1acc95d6a
parent 285e73894250204ec423495288a6c28baddd9c59
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Sat, 28 May 2022 15:12:42 +0800

fix(winbar): fix winbar disappear or glitch when moving a split (#18775)


Diffstat:
Msrc/nvim/window.c | 3++-
Mtest/functional/ui/winbar_spec.lua | 36++++++++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/src/nvim/window.c b/src/nvim/window.c @@ -1334,7 +1334,6 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir) set_fraction(oldwin); } wp->w_fraction = oldwin->w_fraction; - wp->w_winbar_height = oldwin->w_winbar_height; if (flags & WSP_VERT) { wp->w_p_scr = curwin->w_p_scr; @@ -1571,6 +1570,8 @@ static void win_init(win_T *newp, win_T *oldp, int flags) copyFoldingState(oldp, newp); win_init_some(newp, oldp); + + newp->w_winbar_height = oldp->w_winbar_height; } /* diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua @@ -459,4 +459,40 @@ describe('winbar', function() | ]]} end) + + it('works correctly when moving a split', function() + screen:try_resize(45, 6) + command('set winbar=') + command('vsplit') + command('setlocal winbar=foo') + screen:expect([[ + {1:foo }│ | + ^ │{3:~ }| + {3:~ }│{3:~ }| + {3:~ }│{3:~ }| + {4:[No Name] }{2:[No Name] }| + | + ]]) + + command('wincmd L') + screen:expect([[ + │{1:foo }| + {3:~ }│^ | + {3:~ }│{3:~ }| + {3:~ }│{3:~ }| + {2:[No Name] }{4:[No Name] }| + | + ]]) + + command('wincmd w') + command('wincmd L') + screen:expect([[ + {1:foo }│^ | + │{3:~ }| + {3:~ }│{3:~ }| + {3:~ }│{3:~ }| + {2:[No Name] }{4:[No Name] }| + | + ]]) + end) end)