mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(terminal): ignore left-release mouse action
if it is not proccesed by the terminal program to prevent leaving Terminal mode after using a mouse for window switching closes #9483 closes #8691
This commit is contained in:
parent
2fe60905f6
commit
c96f7e29dc
@ -1296,6 +1296,12 @@ static bool send_mouse_event(Terminal *term, int c)
|
|||||||
return mouse_win == curwin;
|
return mouse_win == curwin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ignore left release action if it was not proccessed above
|
||||||
|
// to prevent leaving Terminal mode after entering to it using a mouse
|
||||||
|
if (c == K_LEFTRELEASE && mouse_win->w_buffer->terminal == term) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
ins_char_typebuf(c);
|
ins_char_typebuf(c);
|
||||||
return true;
|
return true;
|
||||||
|
@ -45,6 +45,12 @@ describe(':terminal mouse', function()
|
|||||||
eq('nt', eval('mode(1)'))
|
eq('nt', eval('mode(1)'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('does not leave terminal mode on left-release', function()
|
||||||
|
if helpers.pending_win32(pending) then return end
|
||||||
|
feed('<LeftRelease>')
|
||||||
|
eq('t', eval('mode(1)'))
|
||||||
|
end)
|
||||||
|
|
||||||
describe('with mouse events enabled by the program', function()
|
describe('with mouse events enabled by the program', function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
thelpers.enable_mouse()
|
thelpers.enable_mouse()
|
||||||
|
Loading…
Reference in New Issue
Block a user