fix(mouse): statusline click registered as statuscolumn (#21748)

fix(statuscolumn): statusline click registered as statuscolumn

Problem:  Status line click is registered as status status column click.
Solution: Check that mouse is not on the status line.

Resolve https://github.com/luukvbaal/statuscol.nvim/issues/4.
This commit is contained in:
luukvbaal
2023-01-13 00:36:59 +01:00
committed by GitHub
parent f2141de9e4
commit 4876654d4c
2 changed files with 9 additions and 1 deletions

View File

@@ -1110,7 +1110,7 @@ retnomove:
? wp->w_winbar_height != 0
: false;
on_statuscol = (grid == (col < win_col_off(wp)))
on_statuscol = !on_status_line && !on_winbar && col < win_col_off(wp)
? *wp->w_p_stc != NUL
: false;

View File

@@ -366,6 +366,14 @@ describe('statuscolumn', function()
eq('0 3 r 7', eval("g:testvar"))
meths.input_mouse('right', 'press', '', 0, 3, 0)
eq('0 4 r 7', eval("g:testvar"))
command('set laststatus=2 winbar=%f')
command('let g:testvar=""')
-- Check that winbar click doesn't register as statuscolumn click
meths.input_mouse('right', 'press', '', 0, 0, 0)
eq('', eval("g:testvar"))
-- Check that statusline click doesn't register as statuscolumn click
meths.input_mouse('right', 'press', '', 0, 12, 0)
eq('', eval("g:testvar"))
end)
it('fits maximum multibyte foldcolumn #21759', function()