From 81d4e96bc8685876943d8a7549004f128501da17 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 5 Jul 2024 07:24:45 +0800 Subject: fix(mouse): don't treat click on hsep as click on statusline (#29565) This allows showing popup menu when right-clicking on hsep or cmdline. --- src/nvim/mouse.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/nvim') diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index bd245bdca3..6bd40003ea 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -250,11 +250,17 @@ static int get_fpos_of_mouse(pos_T *mpos) } // winpos and height may change in win_enter()! - if (winrow >= wp->w_height_inner) { // In (or below) status line + if (winrow >= wp->w_height_inner + wp->w_status_height) { // Below window + if (mouse_grid <= 1 && mouse_row < Rows - p_ch + && mouse_row >= Rows - p_ch - global_stl_height()) { // In global status line + return IN_STATUS_LINE; + } + return IN_UNKNOWN; + } else if (winrow >= wp->w_height_inner) { // In window status line return IN_STATUS_LINE; } - if (winrow < 0 && winrow + wp->w_winbar_height >= 0) { + if (winrow < 0 && winrow + wp->w_winbar_height >= 0) { // In winbar return MOUSE_WINBAR; } -- cgit