mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #21731 from tk-shirasaka/fix/builtin_popup_on_ext_popupmenu
fix: properly close builtin popup in ext_popupmenu
This commit is contained in:
commit
43feb973e3
@ -878,6 +878,7 @@ void pum_check_clear(void)
|
||||
grid_free(&pum_grid);
|
||||
}
|
||||
pum_is_drawn = false;
|
||||
pum_external = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user