mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
fix(terminal): fix duplicate recording with mouse click (#28103)
This commit is contained in:
parent
5a5d26b4ab
commit
74776dfb2a
@ -1631,7 +1631,10 @@ end:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ins_char_typebuf(vgetc_char, vgetc_mod_mask);
|
int len = ins_char_typebuf(vgetc_char, vgetc_mod_mask);
|
||||||
|
if (KeyTyped) {
|
||||||
|
ungetchars(len);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ describe(':terminal mouse', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('will exit focus and trigger Normal mode mapping on mouse click', function()
|
it('will exit focus and trigger Normal mode mapping on mouse click', function()
|
||||||
|
feed([[<C-\><C-N>qri]])
|
||||||
command('let g:got_leftmouse = 0')
|
command('let g:got_leftmouse = 0')
|
||||||
command('nnoremap <LeftMouse> <Cmd>let g:got_leftmouse = 1<CR>')
|
command('nnoremap <LeftMouse> <Cmd>let g:got_leftmouse = 1<CR>')
|
||||||
eq('t', eval('mode(1)'))
|
eq('t', eval('mode(1)'))
|
||||||
@ -48,9 +49,12 @@ describe(':terminal mouse', function()
|
|||||||
feed('<LeftMouse>')
|
feed('<LeftMouse>')
|
||||||
eq('nt', eval('mode(1)'))
|
eq('nt', eval('mode(1)'))
|
||||||
eq(1, eval('g:got_leftmouse'))
|
eq(1, eval('g:got_leftmouse'))
|
||||||
|
feed('q')
|
||||||
|
eq('i<LeftMouse>', eval('keytrans(@r)'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('will exit focus and trigger Normal mode mapping on mouse click with modifier', function()
|
it('will exit focus and trigger Normal mode mapping on mouse click with modifier', function()
|
||||||
|
feed([[<C-\><C-N>qri]])
|
||||||
command('let g:got_ctrl_leftmouse = 0')
|
command('let g:got_ctrl_leftmouse = 0')
|
||||||
command('nnoremap <C-LeftMouse> <Cmd>let g:got_ctrl_leftmouse = 1<CR>')
|
command('nnoremap <C-LeftMouse> <Cmd>let g:got_ctrl_leftmouse = 1<CR>')
|
||||||
eq('t', eval('mode(1)'))
|
eq('t', eval('mode(1)'))
|
||||||
@ -58,6 +62,8 @@ describe(':terminal mouse', function()
|
|||||||
feed('<C-LeftMouse>')
|
feed('<C-LeftMouse>')
|
||||||
eq('nt', eval('mode(1)'))
|
eq('nt', eval('mode(1)'))
|
||||||
eq(1, eval('g:got_ctrl_leftmouse'))
|
eq(1, eval('g:got_ctrl_leftmouse'))
|
||||||
|
feed('q')
|
||||||
|
eq('i<C-LeftMouse>', eval('keytrans(@r)'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('will exit focus on <C-\\> + mouse-scroll', function()
|
it('will exit focus on <C-\\> + mouse-scroll', function()
|
||||||
|
Loading…
Reference in New Issue
Block a user