From c96f7e29dc69976c2f5efa0a59710ef8416bb982 Mon Sep 17 00:00:00 2001 From: dm1try Date: Thu, 9 Dec 2021 19:44:09 +0300 Subject: 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 --- src/nvim/terminal.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index afebda4948..c272fdb7b0 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -1296,6 +1296,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; -- cgit