File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ local definitions = {
9090 target = target :sub (e + 1 )
9191 end
9292 -- nvim_parse_cmd throw error when the cmdline contains range specifier.
93- return vim .api .nvim_parse_cmd (target , {}) or {}
93+ return vim .api .nvim_parse_cmd (target , { mods = { silent = true } }) or {}
9494 end )
9595 parsed = parsed or {}
9696
@@ -126,8 +126,11 @@ local definitions = {
126126 local is_option_name_completion = OPTION_NAME_COMPLETION_REGEX :match_str (cmdline ) ~= nil
127127
128128 local items = {}
129- local escaped = cmdline :gsub ([[ \\]] , [[ \\\\]] );
130- for _ , word_or_item in ipairs (vim .fn .getcompletion (escaped , ' cmdline' )) do
129+ local cmdtype = vim .fn .getcmdcompltype ()
130+ if cmdtype == ' ' or vim .fn .getcmdtype () ~= ' @' then
131+ cmdtype = ' cmdline'
132+ end
133+ for _ , word_or_item in ipairs (vim .fn .getcompletion (cmdline , cmdtype )) do
131134 local word = type (word_or_item ) == ' string' and word_or_item or word_or_item .word
132135 local item = { label = word }
133136 table.insert (items , item )
You can’t perform that action at this time.
0 commit comments