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

This commit is contained in:
zeertzjq 2022-05-28 15:12:42 +08:00 committed by GitHub
parent 285e738942
commit 77d9c672f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 1 deletions

View File

@ -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;
}
/*

View File

@ -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)