Merge pull request #16596 from dm1try/do_not_leave_terminal_mode_after_mouse_activation

do not leave Terminal mode after entering to it using a mouse
This commit is contained in:
Björn Linse 2021-12-26 19:11:51 +01:00 committed by GitHub
commit 99526dc9b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -1295,6 +1295,12 @@ static bool send_mouse_event(Terminal *term, int c)
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:
ins_char_typebuf(c);
return true;

View File

@ -45,6 +45,12 @@ describe(':terminal mouse', function()
eq('nt', eval('mode(1)'))
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()
before_each(function()
thelpers.enable_mouse()