aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/mouse_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui/mouse_spec.lua')
-rw-r--r--test/functional/ui/mouse_spec.lua141
1 files changed, 80 insertions, 61 deletions
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index baacef358f..69b0d1ecec 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -32,7 +32,7 @@ describe('ui/mouse/input', function()
[6] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
[7] = {bold = true, foreground = Screen.colors.SeaGreen4},
})
- command("set display-=msgsep")
+ command("set display-=msgsep mousemodel=extend")
feed('itesting<cr>mouse<cr>support and selection<esc>')
screen:expect([[
testing |
@@ -595,54 +595,54 @@ describe('ui/mouse/input', function()
feed('ifoo\nbar<esc>')
screen:expect{grid=[[
- testing {4:│}testing |
- mouse {4:│}mouse |
- support and selection {4:│}support and selection |
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│[No Name] [+] }|
- {0:~ }{4:│}foo{0:$} |
- {0:~ }{4:│}ba^r{0:$} |
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
+ testing │testing |
+ mouse │mouse |
+ support and selection │support and selection |
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{4:[No Name] [+] }|
+ {0:~ }│foo{0:$} |
+ {0:~ }│ba^r{0:$} |
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
{4:[No Name] [+] }{5:[No Name] [+] }|
|
]]}
meths.input_mouse('left', 'press', '', 0, 6, 27)
screen:expect{grid=[[
- testing {4:│}testing |
- mouse {4:│}mouse |
- support and selection {4:│}support and selection |
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│[No Name] [+] }|
- {0:~ }{4:│}^foo{0:$} |
- {0:~ }{4:│}bar{0:$} |
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
+ testing │testing |
+ mouse │mouse |
+ support and selection │support and selection |
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{4:[No Name] [+] }|
+ {0:~ }│^foo{0:$} |
+ {0:~ }│bar{0:$} |
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
{4:[No Name] [+] }{5:[No Name] [+] }|
|
]]}
meths.input_mouse('left', 'drag', '', 0, 7, 30)
screen:expect{grid=[[
- testing {4:│}testing |
- mouse {4:│}mouse |
- support and selection {4:│}support and selection |
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│[No Name] [+] }|
- {0:~ }{4:│}{1:foo}{3:$} |
- {0:~ }{4:│}{1:bar}{0:^$} |
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
- {0:~ }{4:│}{0:~ }|
+ testing │testing |
+ mouse │mouse |
+ support and selection │support and selection |
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{4:[No Name] [+] }|
+ {0:~ }│{1:foo}{3:$} |
+ {0:~ }│{1:bar}{0:^$} |
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
{4:[No Name] [+] }{5:[No Name] [+] }|
{2:-- VISUAL --} |
]]}
@@ -729,12 +729,12 @@ describe('ui/mouse/input', function()
feed('k')
feed_command('sp', 'vsp')
screen:expect([[
- lines {4:│}lines |
- to {4:│}to |
- test {4:│}test |
- ^mouse scrolling {4:│}mouse scrolling |
- {4:│} |
- {0:~ }{4:│}{0:~ }|
+ lines │lines |
+ to │to |
+ test │test |
+ ^mouse scrolling │mouse scrolling |
+ │ |
+ {0:~ }│{0:~ }|
{5:[No Name] [+] }{4:[No Name] [+] }|
to |
test |
@@ -750,12 +750,12 @@ describe('ui/mouse/input', function()
feed('<ScrollWheelDown><0,0>')
end
screen:expect([[
- ^mouse scrolling {4:│}lines |
- {4:│}to |
- {0:~ }{4:│}test |
- {0:~ }{4:│}mouse scrolling |
- {0:~ }{4:│} |
- {0:~ }{4:│}{0:~ }|
+ ^mouse scrolling │lines |
+ │to |
+ {0:~ }│test |
+ {0:~ }│mouse scrolling |
+ {0:~ }│ |
+ {0:~ }│{0:~ }|
{5:[No Name] [+] }{4:[No Name] [+] }|
to |
test |
@@ -771,12 +771,12 @@ describe('ui/mouse/input', function()
feed('<ScrollWheelUp><27,0>')
end
screen:expect([[
- ^mouse scrolling {4:│}text |
- {4:│}with |
- {0:~ }{4:│}many |
- {0:~ }{4:│}lines |
- {0:~ }{4:│}to |
- {0:~ }{4:│}test |
+ ^mouse scrolling │text |
+ │with |
+ {0:~ }│many |
+ {0:~ }│lines |
+ {0:~ }│to |
+ {0:~ }│test |
{5:[No Name] [+] }{4:[No Name] [+] }|
to |
test |
@@ -793,12 +793,12 @@ describe('ui/mouse/input', function()
feed('<ScrollWheelUp><27,7><ScrollWheelUp>')
end
screen:expect([[
- ^mouse scrolling {4:│}text |
- {4:│}with |
- {0:~ }{4:│}many |
- {0:~ }{4:│}lines |
- {0:~ }{4:│}to |
- {0:~ }{4:│}test |
+ ^mouse scrolling │text |
+ │with |
+ {0:~ }│many |
+ {0:~ }│lines |
+ {0:~ }│to |
+ {0:~ }│test |
{5:[No Name] [+] }{4:[No Name] [+] }|
Inserting |
text |
@@ -1571,4 +1571,23 @@ describe('ui/mouse/input', function()
meths.set_option('winwidth', winwidth)
meths.input_mouse('left', 'release', '', 0, 0, 0)
end)
+
+ it('scroll keys are not translated into multiclicks #6211 #6989', function()
+ meths.set_var('mouse_up', 0)
+ meths.set_var('mouse_up2', 0)
+ meths.set_var('mouse_up3', 0)
+ meths.set_var('mouse_up4', 0)
+ command('nnoremap <ScrollWheelUp> <Cmd>let g:mouse_up += 1<CR>')
+ command('nnoremap <2-ScrollWheelUp> <Cmd>let g:mouse_up2 += 1<CR>')
+ command('nnoremap <3-ScrollWheelUp> <Cmd>let g:mouse_up3 += 1<CR>')
+ command('nnoremap <4-ScrollWheelUp> <Cmd>let g:mouse_up4 += 1<CR>')
+ meths.input_mouse('wheel', 'up', '', 0, 0, 0)
+ meths.input_mouse('wheel', 'up', '', 0, 0, 0)
+ meths.input_mouse('wheel', 'up', '', 0, 0, 0)
+ meths.input_mouse('wheel', 'up', '', 0, 0, 0)
+ eq(4, meths.get_var('mouse_up'))
+ eq(0, meths.get_var('mouse_up2'))
+ eq(0, meths.get_var('mouse_up3'))
+ eq(0, meths.get_var('mouse_up4'))
+ end)
end)