mirror of
https://github.com/neovim/neovim.git
synced 2026-08-31 03:13:48 +00:00
fix(cmdline): fix inconsistent behavior with ext_popupmenu (#35688)
This commit is contained in:
@@ -454,7 +454,7 @@ local function test_cmdline(linegrid)
|
||||
}
|
||||
end)
|
||||
|
||||
it('works together with ext_popupmenu', function()
|
||||
local function test_ext_cmdline_popupmenu()
|
||||
local expected = {
|
||||
{ 'define', '', '', '' },
|
||||
{ 'jump', '', '', '' },
|
||||
@@ -557,19 +557,63 @@ local function test_cmdline(linegrid)
|
||||
{1:~ }|*3
|
||||
|
|
||||
]],
|
||||
cmdline = {
|
||||
{
|
||||
content = { { 'e wildpum/Xnamedir/XdirA/' } },
|
||||
firstc = ':',
|
||||
pos = 25,
|
||||
},
|
||||
},
|
||||
cmdline = { { content = { { 'e wildpum/Xnamedir/XdirA/' } }, firstc = ':', pos = 25 } },
|
||||
popupmenu = {
|
||||
anchor = { -1, 0, 19 },
|
||||
items = { { 'XdirA/', '', '', '' }, { 'XfileA', '', '', '' } },
|
||||
pos = 0,
|
||||
},
|
||||
}
|
||||
|
||||
feed('<Esc>')
|
||||
command('set wildmode=longest,full')
|
||||
feed(':sign u<tab>')
|
||||
screen:expect {
|
||||
grid = [[
|
||||
^ |
|
||||
{1:~ }|*3
|
||||
|
|
||||
]],
|
||||
cmdline = { { content = { { 'sign un' } }, firstc = ':', pos = 7 } },
|
||||
}
|
||||
|
||||
feed('<tab>')
|
||||
local s_undefine_unplace_0 = {
|
||||
grid = [[
|
||||
^ |
|
||||
{1:~ }|*3
|
||||
|
|
||||
]],
|
||||
cmdline = { { content = { { 'sign undefine' } }, firstc = ':', pos = 13 } },
|
||||
popupmenu = {
|
||||
anchor = { -1, 0, 5 },
|
||||
items = { { 'undefine', '', '', '' }, { 'unplace', '', '', '' } },
|
||||
pos = 0,
|
||||
},
|
||||
}
|
||||
screen:expect(s_undefine_unplace_0)
|
||||
|
||||
feed('<Esc>')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{1:~ }|*3
|
||||
|
|
||||
]])
|
||||
|
||||
feed(':sign un<tab>')
|
||||
screen:expect(s_undefine_unplace_0)
|
||||
end
|
||||
|
||||
describe('works together with ext_popupmenu', function()
|
||||
it('with wildoptions=pum', function()
|
||||
command('set wildoptions=pum')
|
||||
test_ext_cmdline_popupmenu()
|
||||
end)
|
||||
|
||||
it('with wildoptions=', function()
|
||||
command('set wildoptions=')
|
||||
test_ext_cmdline_popupmenu()
|
||||
end)
|
||||
end)
|
||||
|
||||
it('ext_wildmenu takes precedence over ext_popupmenu', function()
|
||||
|
||||
Reference in New Issue
Block a user