aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-07 10:18:12 +0800
committerGitHub <noreply@github.com>2022-12-07 10:18:12 +0800
commiteab71e7875782144ca6c62269fc6f333bc061001 (patch)
tree3578fa103a1a65d159934172ab9459cb90c9ea60 /test/functional/ui/float_spec.lua
parentad244a865be5332471ec07875603c3dd4a7af0ae (diff)
downloadrneovim-eab71e7875782144ca6c62269fc6f333bc061001.tar.gz
rneovim-eab71e7875782144ca6c62269fc6f333bc061001.tar.bz2
rneovim-eab71e7875782144ca6c62269fc6f333bc061001.zip
test: add more tests for float window bufpos (#21318)
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r--test/functional/ui/float_spec.lua109
1 files changed, 109 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index bc05d9081d..dbf31ad753 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -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)
@@ -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=[[
@@ -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()