aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/functional/terminal/tui_spec.lua28
-rw-r--r--test/functional/ui/popupmenu_spec.lua70
2 files changed, 93 insertions, 5 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index 9dd5b00b83..d63338845a 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -655,6 +655,20 @@ describe('TUI', function()
end
screen:expect_unchanged()
if esc then
+ feed_data('\027[<64;5;1M')
+ else
+ api.nvim_input_mouse('wheel', 'up', '', 0, 0, 4)
+ end
+ screen:expect([[
+ {1:p}opup menu test |
+ {4:~ }{14: foo }{4: }|
+ {4:~ }{13: bar }{4: }|
+ {4:~ }{13: baz }{4: }|
+ {5:[No Name] [+] }|
+ |
+ {3:-- TERMINAL --} |
+ ]])
+ if esc then
feed_data('\027[<35;7;4M')
else
api.nvim_input_mouse('move', '', '', 0, 3, 6)
@@ -669,6 +683,20 @@ describe('TUI', function()
{3:-- TERMINAL --} |
]])
if esc then
+ feed_data('\027[<65;7;4M')
+ else
+ api.nvim_input_mouse('wheel', 'down', '', 0, 3, 6)
+ end
+ screen:expect([[
+ {1:p}opup menu test |
+ {4:~ }{13: foo }{4: }|
+ {4:~ }{14: bar }{4: }|
+ {4:~ }{13: baz }{4: }|
+ {5:[No Name] [+] }|
+ |
+ {3:-- TERMINAL --} |
+ ]])
+ if esc then
feed_data('\027[<0;7;3M')
else
api.nvim_input_mouse('left', 'press', '', 0, 2, 6)
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua
index 1f7d187016..1f0d20f66d 100644
--- a/test/functional/ui/popupmenu_spec.lua
+++ b/test/functional/ui/popupmenu_spec.lua
@@ -3784,9 +3784,7 @@ describe('builtin popupmenu', function()
{n: bar }|
{n: baz }|
]],
- float_pos = {
- [4] = { -1, 'NW', 2, 1, 17, false, 250 },
- },
+ float_pos = { [4] = { -1, 'NW', 2, 1, 17, false, 250 } },
}
else
feed('<RightMouse><18,0>')
@@ -3969,7 +3967,38 @@ describe('builtin popupmenu', function()
end
eq(true, screen.options.mousemoveevent)
if multigrid then
- api.nvim_input_mouse('move', '', '', 2, 3, 6)
+ api.nvim_input_mouse('wheel', 'up', '', 2, 0, 4)
+ screen:expect({
+ grid = [[
+ ## grid 1
+ [2:--------------------------------]|*5
+ [3:--------------------------------]|
+ ## grid 2
+ ^popup menu test |
+ {1:~ }|*4
+ ## grid 3
+ :let g:menustr = 'foo' |
+ ## grid 4
+ {s: foo }|
+ {n: bar }|
+ {n: baz }|
+ ]],
+ float_pos = { [4] = { -1, 'NW', 2, 1, 3, false, 250 } },
+ })
+ else
+ feed('<ScrollWheelUp><4,0>')
+ screen:expect([[
+ ^popup menu test |
+ {1:~ }{s: foo }{1: }|
+ {1:~ }{n: bar }{1: }|
+ {1:~ }{n: baz }{1: }|
+ {1:~ }|
+ :let g:menustr = 'foo' |
+ ]])
+ end
+ eq(true, screen.options.mousemoveevent)
+ if multigrid then
+ api.nvim_input_mouse('move', '', '', 4, 2, 3)
screen:expect({
grid = [[
## grid 1
@@ -4000,7 +4029,38 @@ describe('builtin popupmenu', function()
end
eq(true, screen.options.mousemoveevent)
if multigrid then
- api.nvim_input_mouse('left', 'press', '', 2, 2, 6)
+ api.nvim_input_mouse('wheel', 'down', '', 4, 2, 3)
+ screen:expect({
+ grid = [[
+ ## grid 1
+ [2:--------------------------------]|*5
+ [3:--------------------------------]|
+ ## grid 2
+ ^popup menu test |
+ {1:~ }|*4
+ ## grid 3
+ :let g:menustr = 'foo' |
+ ## grid 4
+ {n: foo }|
+ {s: bar }|
+ {n: baz }|
+ ]],
+ float_pos = { [4] = { -1, 'NW', 2, 1, 3, false, 250 } },
+ })
+ else
+ feed('<ScrollWheelDown><6,3>')
+ screen:expect([[
+ ^popup menu test |
+ {1:~ }{n: foo }{1: }|
+ {1:~ }{s: bar }{1: }|
+ {1:~ }{n: baz }{1: }|
+ {1:~ }|
+ :let g:menustr = 'foo' |
+ ]])
+ end
+ eq(true, screen.options.mousemoveevent)
+ if multigrid then
+ api.nvim_input_mouse('left', 'press', '', 4, 1, 3)
screen:expect({
grid = [[
## grid 1