feat(api): add "move" to nvim_input_mouse

This commit is contained in:
zeertzjq
2022-07-24 13:58:29 +08:00
parent 04bd700ac3
commit ceb09701f2
4 changed files with 85 additions and 5 deletions

View File

@@ -1585,7 +1585,20 @@ describe('ui/mouse/input', function()
eq(0, meths.get_var('mouse_up2'))
end)
it('feeding <MouseMove> does not use uninitialized memory #19480', function()
it('<MouseMove> is not translated into multiclicks and can be mapped', function()
meths.set_var('mouse_move', 0)
meths.set_var('mouse_move2', 0)
command('nnoremap <MouseMove> <Cmd>let g:mouse_move += 1<CR>')
command('nnoremap <2-MouseMove> <Cmd>let g:mouse_move2 += 1<CR>')
feed('<MouseMove><0,0>')
feed('<MouseMove><0,0>')
meths.input_mouse('move', '', '', 0, 0, 0)
meths.input_mouse('move', '', '', 0, 0, 0)
eq(4, meths.get_var('mouse_move'))
eq(0, meths.get_var('mouse_move2'))
end)
it('feeding <MouseMove> in Normal mode does not use uninitialized memory #19480', function()
feed('<MouseMove>')
helpers.poke_eventloop()
helpers.assert_alive()