mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
vim-patch:9.1.1608: No command-line completion for :unsilent {command}
Problem: No command-line completion for :unsilent {command}. Solution: Add missing command arg completion (Doug Kearns). (author) Add completion tests for all command modifiers. closes: vim/vim#17524126731c8fd
Co-authored-by: Doug Kearns <dougkearns@gmail.com> (cherry picked from commitfe42c81f2e
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
6c2f06b537
commit
bd4b45dd1b
@@ -1887,6 +1887,7 @@ static const char *set_context_by_cmdname(const char *cmd, cmdidx_T cmdidx, expa
|
|||||||
case CMD_tab:
|
case CMD_tab:
|
||||||
case CMD_tabdo:
|
case CMD_tabdo:
|
||||||
case CMD_topleft:
|
case CMD_topleft:
|
||||||
|
case CMD_unsilent:
|
||||||
case CMD_verbose:
|
case CMD_verbose:
|
||||||
case CMD_vertical:
|
case CMD_vertical:
|
||||||
case CMD_windo:
|
case CMD_windo:
|
||||||
|
@@ -1,5 +1,23 @@
|
|||||||
" Test for all command modifiers in
|
" Test for all command modifiers in
|
||||||
|
|
||||||
|
let s:luaeval_cmdmods =<< trim END
|
||||||
|
vim.iter(loadfile('../../../src/nvim/ex_cmds.lua')()):map(function(cmd)
|
||||||
|
if cmd.func == 'ex_wrongmodifier' or cmd.command == 'hide' then
|
||||||
|
return cmd.command
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end):totable()
|
||||||
|
END
|
||||||
|
let s:cmdmods = []
|
||||||
|
|
||||||
|
func s:get_cmdmods()
|
||||||
|
if empty(s:cmdmods)
|
||||||
|
let s:cmdmods = luaeval(s:luaeval_cmdmods->join("\n"))
|
||||||
|
endif
|
||||||
|
return s:cmdmods
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_keep_cmdmods_names()
|
func Test_keep_cmdmods_names()
|
||||||
call assert_equal('k', fullcommand(':k'))
|
call assert_equal('k', fullcommand(':k'))
|
||||||
call assert_equal('k', fullcommand(':ke'))
|
call assert_equal('k', fullcommand(':ke'))
|
||||||
@@ -29,10 +47,13 @@ func Test_keep_cmdmods_names()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_cmdmod_completion()
|
func Test_cmdmod_completion()
|
||||||
call assert_equal('edit', getcompletion('keepalt ed', 'cmdline')[0])
|
for mod in s:get_cmdmods()
|
||||||
call assert_equal('edit', getcompletion('keepjumps ed', 'cmdline')[0])
|
let cmd = $'{mod} ed'
|
||||||
call assert_equal('edit', getcompletion('keepmarks ed', 'cmdline')[0])
|
if mod == 'filter'
|
||||||
call assert_equal('edit', getcompletion('keeppatterns ed', 'cmdline')[0])
|
let cmd = $'{mod} /pattern/ ed'
|
||||||
|
endif
|
||||||
|
call assert_equal('edit', getcompletion(cmd, 'cmdline')[0])
|
||||||
|
endfor
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Reference in New Issue
Block a user