mirror of
https://github.com/neovim/neovim.git
synced 2026-04-30 11:14:10 +00:00
fix(terminal): check if mouse on statusline/tabline/winbar/vsep (#26892)
This commit is contained in:
@@ -243,6 +243,134 @@ describe(':terminal mouse', function()
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
end)
|
||||
|
||||
it('will lose focus if statusline is clicked', function()
|
||||
command('set laststatus=2')
|
||||
screen:expect([[
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
rows: 5, cols: 50 |
|
||||
{1: } |
|
||||
========== |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<LeftMouse><0,5>')
|
||||
screen:expect([[
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
rows: 5, cols: 50 |
|
||||
{2:^ } |
|
||||
========== |
|
||||
|
|
||||
]])
|
||||
feed('<LeftDrag><0,4>')
|
||||
screen:expect([[
|
||||
mouse enabled |
|
||||
rows: 5, cols: 50 |
|
||||
rows: 4, cols: 50 |
|
||||
{2:^ } |
|
||||
========== |
|
||||
|*2
|
||||
]])
|
||||
end)
|
||||
|
||||
it('will lose focus if right separator is clicked', function()
|
||||
command('rightbelow vnew | wincmd p | startinsert')
|
||||
screen:expect([[
|
||||
line29 │ |
|
||||
line30 │{4:~ }|
|
||||
mouse enabled │{4:~ }|
|
||||
rows: 5, cols: 24 │{4:~ }|
|
||||
{1: } │{4:~ }|
|
||||
========== ========== |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<LeftMouse><24,0>')
|
||||
screen:expect([[
|
||||
line29 │ |
|
||||
line30 │{4:~ }|
|
||||
mouse enabled │{4:~ }|
|
||||
rows: 5, cols: 24 │{4:~ }|
|
||||
{2:^ } │{4:~ }|
|
||||
========== ========== |
|
||||
|
|
||||
]])
|
||||
feed('<LeftDrag><23,0>')
|
||||
screen:expect([[
|
||||
line30 │ |
|
||||
mouse enabled │{4:~ }|
|
||||
rows: 5, cols: 24 │{4:~ }|
|
||||
rows: 5, cols: 23 │{4:~ }|
|
||||
{2:^ } │{4:~ }|
|
||||
========== ========== |
|
||||
|
|
||||
]])
|
||||
end)
|
||||
|
||||
it('will lose focus if winbar/tabline is clicked', function()
|
||||
command('setlocal winbar=WINBAR')
|
||||
screen:expect([[
|
||||
{3:WINBAR }|
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
rows: 5, cols: 50 |
|
||||
{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<LeftMouse><0,0>')
|
||||
screen:expect([[
|
||||
{3:WINBAR }|
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
rows: 5, cols: 50 |
|
||||
{2:^ } |
|
||||
|
|
||||
]])
|
||||
command('set showtabline=2 tabline=TABLINE | startinsert')
|
||||
screen:expect([[
|
||||
{1:TABLINE }|
|
||||
{3:WINBAR }|
|
||||
mouse enabled |
|
||||
rows: 5, cols: 50 |
|
||||
rows: 4, cols: 50 |
|
||||
{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<LeftMouse><0,0>')
|
||||
screen:expect([[
|
||||
{1:TABLINE }|
|
||||
{3:WINBAR }|
|
||||
mouse enabled |
|
||||
rows: 5, cols: 50 |
|
||||
rows: 4, cols: 50 |
|
||||
{2:^ } |
|
||||
|
|
||||
]])
|
||||
command('setlocal winbar= | startinsert')
|
||||
screen:expect([[
|
||||
{1:TABLINE }|
|
||||
mouse enabled |
|
||||
rows: 5, cols: 50 |
|
||||
rows: 4, cols: 50 |
|
||||
rows: 5, cols: 50 |
|
||||
{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<LeftMouse><0,0>')
|
||||
screen:expect([[
|
||||
{1:TABLINE }|
|
||||
mouse enabled |
|
||||
rows: 5, cols: 50 |
|
||||
rows: 4, cols: 50 |
|
||||
rows: 5, cols: 50 |
|
||||
{2:^ } |
|
||||
|
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('with a split window and other buffer', function()
|
||||
|
||||
Reference in New Issue
Block a user