mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
fix(completion): don't include <Lua function> in -complete= (#30209)
This commit is contained in:
parent
f046c3eca6
commit
bfa365a872
@ -415,7 +415,7 @@ char *get_user_cmd_complete(expand_T *xp, int idx)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
char *cmd_compl = get_command_complete(idx);
|
char *cmd_compl = get_command_complete(idx);
|
||||||
if (cmd_compl == NULL) {
|
if (cmd_compl == NULL || idx == EXPAND_USER_LUA) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return cmd_compl;
|
return cmd_compl;
|
||||||
|
@ -4,7 +4,7 @@ local Screen = require('test.functional.ui.screen')
|
|||||||
|
|
||||||
local assert_alive = n.assert_alive
|
local assert_alive = n.assert_alive
|
||||||
local clear, feed = n.clear, n.feed
|
local clear, feed = n.clear, n.feed
|
||||||
local eval, eq, neq = n.eval, t.eq, t.neq
|
local eval, eq, neq, ok = n.eval, t.eq, t.neq, t.ok
|
||||||
local feed_command, source, expect = n.feed_command, n.source, n.expect
|
local feed_command, source, expect = n.feed_command, n.source, n.expect
|
||||||
local fn = n.fn
|
local fn = n.fn
|
||||||
local command = n.command
|
local command = n.command
|
||||||
@ -947,6 +947,12 @@ describe('completion', function()
|
|||||||
eq('SpecialKey', fn.getcompletion('set winhighlight=NonText:', 'cmdline')[1])
|
eq('SpecialKey', fn.getcompletion('set winhighlight=NonText:', 'cmdline')[1])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('cmdline completion for -complete does not contain spaces', function()
|
||||||
|
for _, str in ipairs(fn.getcompletion('command -complete=', 'cmdline')) do
|
||||||
|
ok(not str:find(' '), 'string without spaces', str)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
describe('from the commandline window', function()
|
describe('from the commandline window', function()
|
||||||
it('is cleared after CTRL-C', function()
|
it('is cleared after CTRL-C', function()
|
||||||
feed('q:')
|
feed('q:')
|
||||||
|
Loading…
Reference in New Issue
Block a user