aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-03-25 08:32:49 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2021-03-25 09:06:09 +0100
commit3000f6c56b8adeb1ce4b447c04221076112ec351 (patch)
treec47c05931420dda4fbe3bd9c905610baea0607c6 /test/functional/ui/float_spec.lua
parent1186f7dd96b054d6a653685089fc845a8f5d2f27 (diff)
downloadrneovim-3000f6c56b8adeb1ce4b447c04221076112ec351.tar.gz
rneovim-3000f6c56b8adeb1ce4b447c04221076112ec351.tar.bz2
rneovim-3000f6c56b8adeb1ce4b447c04221076112ec351.zip
floats: handle interaction with popupmenu and border correctly
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r--test/functional/ui/float_spec.lua125
1 files changed, 125 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index e4824521b0..664b8e7ab7 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -774,6 +774,131 @@ describe('float window', function()
end
end)
+ it('with border show popupmenu', function()
+ screen:try_resize(40,10)
+ local buf = meths.create_buf(false, false)
+ meths.buf_set_lines(buf, 0, -1, true, {'aaa aab ',
+ 'abb acc ', ''})
+ meths.open_win(buf, true, {relative='editor', width=9, height=3, row=0, col=5, border="double"})
+ feed 'G'
+
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [3:----------------------------------------]|
+ ## grid 2
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ## grid 3
+ |
+ ## grid 5
+ {5:╔═════════╗}|
+ {5:║}{1:aaa aab }{5:║}|
+ {5:║}{1:abb acc }{5:║}|
+ {5:║}{1:^ }{5:║}|
+ {5:╚═════════╝}|
+ ]], float_pos={
+ [5] = { { id = 1002 }, "NW", 1, 0, 5, true }
+ }, win_viewport={
+ [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0};
+ [5] = {win = {id = 1002}, topline = 0, botline = 3, curline = 2, curcol = 0};
+ }}
+ else
+ screen:expect{grid=[[
+ {5:╔═════════╗} |
+ {0:~ }{5:║}{1:aaa aab }{5:║}{0: }|
+ {0:~ }{5:║}{1:abb acc }{5:║}{0: }|
+ {0:~ }{5:║}{1:^ }{5:║}{0: }|
+ {0:~ }{5:╚═════════╝}{0: }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]]}
+ end
+
+ feed 'i<c-x><c-p>'
+
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [3:----------------------------------------]|
+ ## grid 2
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ## grid 3
+ {3:-- }{8:match 1 of 4} |
+ ## grid 5
+ {5:╔═════════╗}|
+ {5:║}{1:aaa aab }{5:║}|
+ {5:║}{1:abb acc }{5:║}|
+ {5:║}{1:acc^ }{5:║}|
+ {5:╚═════════╝}|
+ ## grid 6
+ {1: aaa }|
+ {1: aab }|
+ {1: abb }|
+ {13: acc }|
+ ]], float_pos={
+ [5] = { {
+ id = 1002
+ }, "NW", 1, 0, 5, true },
+ [6] = { {
+ id = -1
+ }, "NW", 5, 4, 0, false }
+ }, win_viewport={
+ [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0};
+ [5] = {win = {id = 1002}, topline = 0, botline = 3, curline = 2, curcol = 3};
+ }}
+ else
+ screen:expect{grid=[[
+ {5:╔═════════╗} |
+ {0:~ }{5:║}{1:aaa aab }{5:║}{0: }|
+ {0:~ }{5:║}{1:abb acc }{5:║}{0: }|
+ {0:~ }{5:║}{1:acc^ }{5:║}{0: }|
+ {0:~ }{1: aaa }{0: }|
+ {0:~ }{1: aab }{0: }|
+ {0:~ }{1: abb }{0: }|
+ {0:~ }{13: acc }{0: }|
+ {0:~ }|
+ {3:-- }{8:match 1 of 4} |
+ ]]}
+ end
+ end)
+
it('can have minimum size', function()
insert("the background text")
local buf = meths.create_buf(false, true)