Skip to content

Commit

Permalink
test: add more tests for float window bufpos (neovim#21318)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeertzjq authored and yesean committed Mar 25, 2023
1 parent 1d1e356 commit f944f46
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions test/functional/ui/float_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ describe('float window', function()
[25] = {blend = 100, background = Screen.colors.Gray0};
[26] = {blend = 80, background = Screen.colors.Gray0};
[27] = {background = Screen.colors.LightGray};
[28] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGray};
}
screen:set_default_attr_ids(attrs)
end)
Expand Down Expand Up @@ -3068,6 +3069,66 @@ describe('float window', function()
]]}
end

command('set laststatus=0')
command('botright vnew')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----]{5:│}[6:--------------------]|
[2:----]{5:│}[6:--------------------]|
[2:----]{5:│}[6:--------------------]|
[2:----]{5:│}[6:--------------------]|
[2:----]{5:│}[6:--------------------]|
[2:----]{5:│}[6:--------------------]|
[2:----]{5:│}[6:--------------------]|
[2:----]{5:│}[6:--------------------]|
[2:----]{5:│}[6:--------------------]|
[3:-------------------------]|
## grid 2
exam|
ple |
text|
tha|
t is|
wid|
er t|
han |
the |
## grid 3
|
## grid 5
{1:some info! }|
## grid 6
^ |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
]], float_pos={
[5] = { {
id = 1002
}, "SW", 2, 8, 0, true }
}}
else
screen:expect{grid=[[
exam{5:│}^ |
ple {5:│}{0:~ }|
text{5:│}{0:~ }|
tha{5:│}{0:~ }|
t is{5:│}{0:~ }|
wid{5:│}{0:~ }|
er t{5:│}{0:~ }|
{1:some info! }{0: }|
the {5:│}{0:~ }|
|
]]}
end
command('close')

meths.win_set_config(win, {relative='win', bufpos={1,32}, anchor='NW', col=-2})
if multigrid then
screen:expect{grid=[[
Expand Down Expand Up @@ -3163,6 +3224,54 @@ describe('float window', function()
|
]]}
end

command('%fold')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:-------------------------]|
[2:-------------------------]|
[2:-------------------------]|
[2:-------------------------]|
[2:-------------------------]|
[2:-------------------------]|
[2:-------------------------]|
[2:-------------------------]|
[2:-------------------------]|
[3:-------------------------]|
## grid 2
{28:^+-- 5 lines: just some··}|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
|
## grid 5
{1:some info! }|
]], float_pos={
[5] = { {
id = 1002
}, "NW", 2, 2, 0, true }
}}
else
screen:expect{grid=[[
{28:^+-- 5 lines: just some··}|
{0:~ }|
{1:some info! }{0: }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
|
]]}
end
end)

it('validates cursor even when window is not entered', function()
Expand Down

0 comments on commit f944f46

Please sign in to comment.