Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add more tests for float window bufpos #21318

Merged
merged 1 commit into from
Dec 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: add more tests for float window bufpos
  • Loading branch information
zeertzjq committed Dec 7, 2022
commit 3f8d4c7f427139276eb2bfd24dc99196576a367e
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