fix: properly close builtin popup in ext_popupmenu

This commit is contained in:
shirasaka
2023-01-10 23:40:27 +09:00
committed by shirasaka
parent 9b1112cf48
commit b603d6f9e7
2 changed files with 77 additions and 0 deletions

View File

@@ -878,6 +878,7 @@ void pum_check_clear(void)
grid_free(&pum_grid);
}
pum_is_drawn = false;
pum_external = false;
}
}

View File

@@ -945,6 +945,82 @@ describe('ui/ext_popupmenu', function()
}}
end)
it('does not interfere with mousemodel=popup', function()
exec([[
set mouse=a mousemodel=popup
aunmenu PopUp
menu PopUp.foo :let g:menustr = 'foo'<CR>
menu PopUp.bar :let g:menustr = 'bar'<CR>
menu PopUp.baz :let g:menustr = 'baz'<CR>
]])
feed('o<C-r>=TestComplete()<CR>')
screen:expect{grid=[[
|
foo^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{2:-- INSERT --} |
]], popupmenu={
items=expected,
pos=0,
anchor={1,1,0},
}}
feed('<c-p>')
screen:expect{grid=[[
|
^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{2:-- INSERT --} |
]], popupmenu={
items=expected,
pos=-1,
anchor={1,1,0},
}}
feed('<esc>')
screen:expect{grid=[[
|
^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
|
]]}
feed('<RightMouse><0,0>')
screen:expect([[
|
{7:^foo } |
{7:bar }{1: }|
{7:baz }{1: }|
{1:~ }|
{1:~ }|
{1:~ }|
|
]])
feed('<esc>')
screen:expect([[
|
^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
|
]])
end)
end)