fix(mouse): avoid dragging when clicking next to popupmenu

(cherry picked from commit bce65ee429)
This commit is contained in:
Luuk van Baal
2023-11-24 17:57:50 +01:00
committed by github-actions[bot]
parent 07860aba75
commit a27e683ca5
3 changed files with 27 additions and 19 deletions

View File

@@ -592,7 +592,7 @@ describe('statuscolumn', function()
eq('0 1 l 11', eval("g:testvar"))
end)
it('selecting popupmenu does not drag mouse', function()
it('popupmenu callback does not drag mouse on close', function()
screen:try_resize(screen._width, 2)
screen:set_default_attr_ids({
[0] = {foreground = Screen.colors.Brown},
@@ -606,6 +606,7 @@ describe('statuscolumn', function()
popup PopupStc
endfunction
]])
-- clicking an item does not drag mouse
meths.input_mouse('left', 'press', '', 0, 0, 0)
screen:expect([[
{0:8 }^aaaaa |
@@ -617,6 +618,19 @@ describe('statuscolumn', function()
{0:8 }^aaaaa |
0 1 l 8 |
]])
command('echo')
-- clicking outside to close the menu does not drag mouse
meths.input_mouse('left', 'press', '', 0, 0, 0)
screen:expect([[
{0:8 }^aaaaa |
{1: Echo } |
]])
meths.input_mouse('left', 'press', '', 0, 0, 10)
meths.input_mouse('left', 'release', '', 0, 0, 10)
screen:expect([[
{0:8 }^aaaaa |
|
]])
end)
end)
end