test: improve some input tests

This commit is contained in:
zeertzjq
2022-07-25 08:36:48 +08:00
parent eb77122823
commit 0cc41a61d1
2 changed files with 8 additions and 11 deletions

View File

@@ -1572,23 +1572,17 @@ describe('ui/mouse/input', function()
meths.input_mouse('left', 'release', '', 0, 0, 0)
end)
it('scroll keys are not translated into multiclicks #6211 #6989', function()
it('scroll keys are not translated into multiclicks and can be mapped #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)
feed('<ScrollWheelUp><0,0>')
feed('<ScrollWheelUp><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)
it('feeding <MouseMove> does not use uninitialized memory #19480', function()