diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-07-05 07:24:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-05 07:24:45 +0800 |
commit | 81d4e96bc8685876943d8a7549004f128501da17 (patch) | |
tree | b6c81bd5546773faad3a66ae6b9e8a2198e9ae2e /src | |
parent | 6cbba2b48d604b5fdbd874d75c30c6c55449f33e (diff) | |
download | rneovim-81d4e96bc8685876943d8a7549004f128501da17.tar.gz rneovim-81d4e96bc8685876943d8a7549004f128501da17.tar.bz2 rneovim-81d4e96bc8685876943d8a7549004f128501da17.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/mouse.c | 10 |
1 files changed, 8 insertions, 2 deletions
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; } |