mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
fix(mouse): cmdline click registered as statuscolumn
This commit is contained in:
@@ -1097,7 +1097,8 @@ retnomove:
|
|||||||
return IN_UNKNOWN;
|
return IN_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
on_status_line = (grid == DEFAULT_GRID_HANDLE && row + wp->w_winbar_height >= wp->w_height)
|
bool below_window = grid == DEFAULT_GRID_HANDLE && row + wp->w_winbar_height >= wp->w_height;
|
||||||
|
on_status_line = (below_window)
|
||||||
? row + wp->w_winbar_height - wp->w_height + 1 == 1
|
? row + wp->w_winbar_height - wp->w_height + 1 == 1
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
@@ -1105,7 +1106,7 @@ retnomove:
|
|||||||
? wp->w_winbar_height != 0
|
? wp->w_winbar_height != 0
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
on_statuscol = !on_status_line && !on_winbar && col < win_col_off(wp)
|
on_statuscol = !below_window && !on_status_line && !on_winbar && col < win_col_off(wp)
|
||||||
? *wp->w_p_stc != NUL
|
? *wp->w_p_stc != NUL
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
@@ -1144,7 +1145,7 @@ retnomove:
|
|||||||
dragwin = NULL;
|
dragwin = NULL;
|
||||||
|
|
||||||
// winpos and height may change in win_enter()!
|
// winpos and height may change in win_enter()!
|
||||||
if (grid == DEFAULT_GRID_HANDLE && row + wp->w_winbar_height >= wp->w_height) {
|
if (below_window) {
|
||||||
// In (or below) status line
|
// In (or below) status line
|
||||||
status_line_offset = row + wp->w_winbar_height - wp->w_height + 1;
|
status_line_offset = row + wp->w_winbar_height - wp->w_height + 1;
|
||||||
dragwin = wp;
|
dragwin = wp;
|
||||||
|
@@ -457,6 +457,9 @@ describe('statuscolumn', function()
|
|||||||
-- Check that statusline click doesn't register as statuscolumn click
|
-- Check that statusline click doesn't register as statuscolumn click
|
||||||
meths.input_mouse('right', 'press', '', 0, 12, 0)
|
meths.input_mouse('right', 'press', '', 0, 12, 0)
|
||||||
eq('', eval("g:testvar"))
|
eq('', eval("g:testvar"))
|
||||||
|
-- Check that cmdline click doesn't register as statuscolumn click
|
||||||
|
meths.input_mouse('right', 'press', '', 0, 13, 0)
|
||||||
|
eq('', eval("g:testvar"))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('click labels do not leak memory', function()
|
it('click labels do not leak memory', function()
|
||||||
|
Reference in New Issue
Block a user