]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4122: ":command Cmd" does not show custom completion argument v8.2.4122
authorBram Moolenaar <Bram@vim.org>
Mon, 17 Jan 2022 19:06:56 +0000 (19:06 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 17 Jan 2022 19:06:56 +0000 (19:06 +0000)
Problem:    ":command Cmd" does not show custom completion argument.
Solution:   Show the completion argument when using ":verbose".

src/testdir/test_usercommands.vim
src/usercmd.c
src/version.c

index 808a2c7d8c13dd8ff646c011eabd7baf4c652ea5..b3ba62069833a708e9decdbef9534f2bd4d1c610 100644 (file)
@@ -589,10 +589,10 @@ func Test_command_list()
         \           execute('command DoCmd'))
 
   " Test output in verbose mode.
-  command! DoCmd :
+  command! -nargs=+ -complete=customlist,SomeFunc DoCmd :ls
   call assert_match("^\n"
         \        .. "    Name              Args Address Complete    Definition\n"
-        \        .. "    DoCmd             0                        :\n"
+        \        .. "    DoCmd             +            customlist,SomeFunc :ls\n"
         \        .. "\tLast set from .*/test_usercommands.vim line \\d\\+$",
         \           execute('verbose command DoCmd'))
 
index 70f45aab81a14bc7add741f502c56b46c8423c07..808d36c416d331be96d689bc0442266e930f924b 100644 (file)
@@ -548,6 +548,13 @@ uc_list(char_u *name, size_t name_len)
                {
                    STRCPY(IObuff + len, command_complete[j].name);
                    len += (int)STRLEN(IObuff + len);
+                   if (p_verbose > 0 && cmd->uc_compl_arg != NULL
+                                           && STRLEN(cmd->uc_compl_arg) < 200)
+                   {
+                       IObuff[len] = ',';
+                       STRCPY(IObuff + len + 1, cmd->uc_compl_arg);
+                       len += (int)STRLEN(IObuff + len);
+                   }
                    break;
                }
 
index bc75522484c00bbdb4452cb2b8e8b9897a83360a..bee41fdedf352a2b61b4985d9fe8c0d36a763c7e 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4122,
 /**/
     4121,
 /**/