diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-11-07 17:53:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-07 17:53:30 +0800 |
commit | 5a86360400691e55fae66d60485b61360a1d3d6c (patch) | |
tree | 70532d37555cd106ba2155c408b124e285242c69 /test/functional/ui/mouse_spec.lua | |
parent | 000129201c54d4ba391f7473d0c183f000246c3e (diff) | |
download | rneovim-5a86360400691e55fae66d60485b61360a1d3d6c.tar.gz rneovim-5a86360400691e55fae66d60485b61360a1d3d6c.tar.bz2 rneovim-5a86360400691e55fae66d60485b61360a1d3d6c.zip |
test: add test for key following ignored mouse move (#31104)
Diffstat (limited to 'test/functional/ui/mouse_spec.lua')
-rw-r--r-- | test/functional/ui/mouse_spec.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 09aa3f17b3..471ee70906 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -1922,17 +1922,24 @@ describe('ui/mouse/input', function() end) it('<MouseMove> to same location does not generate events #31103', function() - api.nvim_input_mouse('move', '', '', 0, 0, 3) api.nvim_set_var('mouse_move', 0) api.nvim_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>') + api.nvim_input_mouse('move', '', '', 0, 0, 3) + eq(1, api.nvim_get_var('mouse_move')) + eq(0, api.nvim_get_var('mouse_move2')) feed('<MouseMove><3,0>') feed('<MouseMove><3,0>') api.nvim_input_mouse('move', '', '', 0, 0, 3) api.nvim_input_mouse('move', '', '', 0, 0, 3) - eq(0, api.nvim_get_var('mouse_move')) + eq(1, api.nvim_get_var('mouse_move')) + eq(0, api.nvim_get_var('mouse_move2')) + eq({ mode = 'n', blocking = false }, api.nvim_get_mode()) + feed('<MouseMove><3,0><Insert>') + eq(1, api.nvim_get_var('mouse_move')) eq(0, api.nvim_get_var('mouse_move2')) + eq({ mode = 'i', blocking = false }, api.nvim_get_mode()) end) it('feeding <MouseMove> in Normal mode does not use uninitialized memory #19480', function() |