patch 9.1.1608: No command-line completion for :unsilent {command} Commit: https://github.com/vim/vim/commit/126731c8fde545e8aedb83076badbc8a6ef1201d Author: Doug Kearns <dougkea...@gmail.com> Date: Fri Aug 8 13:34:04 2025 +0200
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: #17524 Signed-off-by: Doug Kearns <dougkea...@gmail.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/src/cmdexpand.c b/src/cmdexpand.c index 9d66b0378..ab849e296 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -2361,6 +2361,7 @@ set_context_by_cmdname( case CMD_tab: case CMD_tabdo: case CMD_topleft: + case CMD_unsilent: case CMD_verbose: case CMD_vertical: case CMD_windo: diff --git a/src/testdir/test_cmdmods.vim b/src/testdir/test_cmdmods.vim index a9117e153..3b0deab7b 100644 --- a/src/testdir/test_cmdmods.vim +++ b/src/testdir/test_cmdmods.vim @@ -1,20 +1,29 @@ " Test for all command modifiers in +def s:memoize_cmdmods(): func(): list<string> + var cmdmods: list<string> = [] + return () => { + if empty(cmdmods) + edit ../ex_docmd.c + var top = search('^static cmdmod_info_T cmdmod_info_tab[') + 1 + var bot = search('^};.*\/\/ cmdmod_info_tab') - 1 + var lines = getline(top, bot) + cmdmods = lines->map((_, v) => substitute(v, '.*"\(\k*\)".*', ' ', '')) + bwipe! + endif + return cmdmods + } +enddef +let s:get_cmdmods = s:memoize_cmdmods() + def Test_cmdmods_array() # Get all the command modifiers from ex_cmds.h. var lines = readfile('../ex_cmds.h')->filter((_, l) => l =~ 'ex_wrongmodifier,') var cmds = lines->map((_, v) => substitute(v, '.*"\(\k*\)".*', ' ', '')) - # :hide is both a command and a modifier cmds->extend(['hide']) - # Get the entries of cmdmod_info_tab[] in ex_docmd.c - edit ../ex_docmd.c - var top = search('^static cmdmod_info_T cmdmod_info_tab[') + 1 - var bot = search('^};.*\/\/ cmdmod_info_tab') - 1 - lines = getline(top, bot) - var mods = lines->map((_, v) => substitute(v, '.*"\(\k*\)".*', ' ', '')) - + var mods = s:get_cmdmods() # Add the other commands that use ex_wrongmodifier. mods->extend([ 'endclass', @@ -73,10 +82,13 @@ def Test_keep_cmdmods_names() enddef def Test_cmdmod_completion() - assert_equal('edit', getcompletion('keepalt ed', 'cmdline')[0]) - assert_equal('edit', getcompletion('keepjumps ed', 'cmdline')[0]) - assert_equal('edit', getcompletion('keepmarks ed', 'cmdline')[0]) - assert_equal('edit', getcompletion('keeppatterns ed', 'cmdline')[0]) + for mod in s:get_cmdmods() + var cmd = $'{mod} ed' + if mod == 'filter' + cmd = $'{mod} /pattern/ ed' + endif + assert_equal('edit', getcompletion(cmd, 'cmdline')[0]) + endfor enddef " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 9ba90af67..c459d7c77 100644 --- a/src/version.c +++ b/src/version.c @@ -719,6 +719,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1608, /**/ 1607, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1ukLWz-002MAs-8l%40256bit.org.