fix(ui): make winbar work with floats and multigrid

This commit is contained in:
bfredl
2022-05-18 13:51:59 +02:00
parent c28192e6f9
commit 17758fe7ad
5 changed files with 93 additions and 4 deletions

View File

@@ -7591,6 +7591,53 @@ describe('float window', function()
]]}
end
end)
it('can use winbar', function()
local buf = meths.create_buf(false,false)
local win1 = meths.open_win(buf, false, {relative='editor', width=15, height=3, row=1, col=5})
meths.win_set_option(win1, 'winbar', 'floaty bar')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[3:----------------------------------------]|
## grid 2
^ |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
|
## grid 4
{3:floaty bar }|
{1: }|
{2:~ }|
]], float_pos={
[4] = {{id = 1001}, "NW", 1, 1, 5, true, 50};
}, win_viewport={
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1};
[4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1};
}}
else
screen:expect{grid=[[
^ |
{0:~ }{3:floaty bar }{0: }|
{0:~ }{1: }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }|
{0:~ }|
|
]]}
end
end)
end
describe('with ext_multigrid', function()

View File

@@ -2369,4 +2369,44 @@ describe('ext_multigrid', function()
[2] = {win = {id = 1000}, topline = 6, botline = 12, curline = 10, curcol = 1, linecount = 11},
}}
end)
it('with winbar', function()
command 'split'
command 'setlocal winbar=very\\ bar'
screen:expect{grid=[[
## grid 1
[4:-----------------------------------------------------]|
[4:-----------------------------------------------------]|
[4:-----------------------------------------------------]|
[4:-----------------------------------------------------]|
[4:-----------------------------------------------------]|
[4:-----------------------------------------------------]|
{11:[No Name] }|
[2:-----------------------------------------------------]|
[2:-----------------------------------------------------]|
[2:-----------------------------------------------------]|
[2:-----------------------------------------------------]|
[2:-----------------------------------------------------]|
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
## grid 3
|
## grid 4
{7:very bar }|
^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
]], win_viewport={
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1};
[4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1};
}}
end)
end)