From e09adfdcffe8a94e09d834bb49f42fd725ddd47b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 5 Jan 2024 10:59:52 +0800 Subject: fix(terminal): check if mouse on statusline/tabline/winbar/vsep (#26892) --- src/nvim/terminal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/nvim/terminal.c') diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index dda629ac27..c6a2cb3354 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -1437,8 +1437,10 @@ static bool send_mouse_event(Terminal *term, int c) } int offset; - if (term->forward_mouse && mouse_win->w_buffer->terminal == term - && col >= (offset = win_col_off(mouse_win))) { + if (term->forward_mouse && mouse_win->w_buffer->terminal == term && row >= 0 + && (grid > 1 || row + mouse_win->w_winbar_height < mouse_win->w_height) + && col >= (offset = win_col_off(mouse_win)) + && (grid > 1 || col < mouse_win->w_width)) { // event in the terminal window and mouse events was enabled by the // program. translate and forward the event int button; -- cgit