aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-09-19 11:49:59 +0200
committerGitHub <noreply@github.com>2023-09-19 11:49:59 +0200
commit2de5cddeb197502c8b3ecf5e7eb1ac929cc2307f (patch)
tree7b7baf5a45d1c3b44399125005e535412956b211 /test/functional/ui/float_spec.lua
parent6405fa4b117263b92f87b17150abd2d1c6ab5881 (diff)
parentfd08fd3de3020647c8ae73f1c7d2cf9a4926c828 (diff)
downloadrneovim-2de5cddeb197502c8b3ecf5e7eb1ac929cc2307f.tar.gz
rneovim-2de5cddeb197502c8b3ecf5e7eb1ac929cc2307f.tar.bz2
rneovim-2de5cddeb197502c8b3ecf5e7eb1ac929cc2307f.zip
Merge pull request #25148 from glepnir/fixed_opt
fix(float): add fixed option
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r--test/functional/ui/float_spec.lua83
1 files changed, 83 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index e37b3ccb5f..fcda0dad74 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -939,6 +939,89 @@ describe('float window', function()
end
end)
+ it('window position fixed', function()
+ local buf = meths.create_buf(false,false)
+ command("set nowrap")
+ local win = meths.open_win(buf, false, {
+ relative='editor', width=20, height=2, row=2, col=30, anchor = 'NW', fixed = true})
+ local expected_pos = {
+ [4]={{id=1001}, 'NW', 1, 2, 30, true},
+ }
+
+ 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
+ {1: }|
+ {2:~ }|
+ ]], float_pos=expected_pos}
+ else
+ screen:expect([[
+ ^ |
+ {0:~ }|
+ {0:~ }{1: }|
+ {0:~ }{2:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
+ end
+
+ meths.win_set_config(win, {
+ relative='editor', width=20, height=2, row=2, col=30, anchor = 'NW', fixed = false})
+
+ 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
+ {1: }|
+ {2:~ }|
+ ]], float_pos=expected_pos}
+ else
+ screen:expect([[
+ ^ |
+ {0:~ }|
+ {0:~ }{1: }|
+ {0:~ }{2:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
+ end
+ end)
+
it('draws correctly with redrawdebug=compositor', function()
-- NB: we do not test that it produces the "correct" debug info
-- (as it is intermediate only, and is allowed to change by internal