mirror of
https://github.com/neovim/neovim.git
synced 2026-08-28 18:11:47 +00:00
feat(api): add forward and back mouse buttons
This commit is contained in:
@@ -758,6 +758,25 @@ describe('ui/mouse/input', function()
|
||||
feed('<cr>')
|
||||
end)
|
||||
|
||||
it('x1 and x2 can be triggered by api', function()
|
||||
meths.set_var('x1_pressed', 0)
|
||||
meths.set_var('x1_released', 0)
|
||||
meths.set_var('x2_pressed', 0)
|
||||
meths.set_var('x2_released', 0)
|
||||
command('nnoremap <X1Mouse> <Cmd>let g:x1_pressed += 1<CR>')
|
||||
command('nnoremap <X1Release> <Cmd>let g:x1_released += 1<CR>')
|
||||
command('nnoremap <X2Mouse> <Cmd>let g:x2_pressed += 1<CR>')
|
||||
command('nnoremap <X2Release> <Cmd>let g:x2_released += 1<CR>')
|
||||
meths.input_mouse('x1', 'press', '', 0, 0, 0)
|
||||
meths.input_mouse('x1', 'release', '', 0, 0, 0)
|
||||
meths.input_mouse('x2', 'press', '', 0, 0, 0)
|
||||
meths.input_mouse('x2', 'release', '', 0, 0, 0)
|
||||
eq(1, meths.get_var('x1_pressed'), 'x1 pressed once')
|
||||
eq(1, meths.get_var('x1_released'), 'x1 released once')
|
||||
eq(1, meths.get_var('x2_pressed'), 'x2 pressed once')
|
||||
eq(1, meths.get_var('x2_released'), 'x2 released once')
|
||||
end)
|
||||
|
||||
it('dragging vertical separator', function()
|
||||
screen:try_resize(45, 5)
|
||||
command('setlocal nowrap')
|
||||
|
||||
Reference in New Issue
Block a user