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.
This commit is contained in:
zeertzjq
2024-07-05 07:24:45 +08:00
committed by GitHub
parent 6cbba2b48d
commit 81d4e96bc8
3 changed files with 27 additions and 5 deletions

View File

@@ -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;
}