mirror of
https://github.com/neovim/neovim.git
synced 2026-05-03 04:25:03 +00:00
test: add tests for #20348
This commit is contained in:
@@ -381,7 +381,7 @@ int nextwild(expand_T *xp, int type, int options, bool escape)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/// Create completion popup menu with items from 'matches'.
|
||||
/// Create completion popup menu with items from "matches".
|
||||
static int cmdline_pum_create(CmdlineInfo *ccline, expand_T *xp, char **matches, int numMatches,
|
||||
bool showtail, bool noselect)
|
||||
{
|
||||
|
||||
@@ -535,12 +535,40 @@ local function test_cmdline(linegrid)
|
||||
{2:långfile1 }|
|
||||
|
|
||||
]],
|
||||
cmdline = { { content = { { 'b långfile1' } }, firstc = ':', pos = 12 } },
|
||||
popupmenu = {
|
||||
anchor = { -1, 0, 2 },
|
||||
items = { { 'långfile1', '', '', '' }, { 'långfile2', '', '', '' } },
|
||||
pos = 0,
|
||||
},
|
||||
cmdline = { { content = { { 'b långfile1' } }, firstc = ':', pos = 12 } },
|
||||
}
|
||||
|
||||
feed('<Esc>')
|
||||
command('silent %bwipe')
|
||||
|
||||
command('set shellslash')
|
||||
-- position is correct when expanding environment variable #20348
|
||||
command('silent cd test/functional/fixtures')
|
||||
n.fn.setenv('XNDIR', 'wildpum/Xnamedir')
|
||||
feed(':e $XNDIR/<Tab>')
|
||||
screen:expect {
|
||||
grid = [[
|
||||
^ |
|
||||
{1:~ }|*3
|
||||
|
|
||||
]],
|
||||
cmdline = {
|
||||
{
|
||||
content = { { 'e wildpum/Xnamedir/XdirA/' } },
|
||||
firstc = ':',
|
||||
pos = 25,
|
||||
},
|
||||
},
|
||||
popupmenu = {
|
||||
anchor = { -1, 0, 19 },
|
||||
items = { { 'XdirA/', '', '', '' }, { 'XfileA', '', '', '' } },
|
||||
pos = 0,
|
||||
},
|
||||
}
|
||||
end)
|
||||
|
||||
|
||||
@@ -4853,7 +4853,7 @@ describe('builtin popupmenu', function()
|
||||
]])
|
||||
|
||||
feed('<esc>')
|
||||
command('close')
|
||||
command('%bwipe')
|
||||
command('set wildmode=full')
|
||||
|
||||
-- special case: when patterns ends with "/", show menu items aligned
|
||||
@@ -4866,6 +4866,18 @@ describe('builtin popupmenu', function()
|
||||
{1:~ }{n: file2 }{1: }|
|
||||
:e compdir/file1^ |
|
||||
]])
|
||||
|
||||
-- position is correct when expanding environment variable #20348
|
||||
command('cd ..')
|
||||
fn.setenv('XNDIR', 'wildpum/Xnamedir')
|
||||
feed('<C-U>e $XNDIR/<Tab>')
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|*11
|
||||
{1:~ }{12: XdirA/ }{1: }|
|
||||
{1:~ }{n: XfileA }{1: }|
|
||||
:e wildpum/Xnamedir/XdirA/^ |
|
||||
]])
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user