diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-17 19:06:56 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-17 19:06:56 +0000 |
commit | 3f3597be3ffa9ae226b2e9831e4ed64c8ae43c42 (patch) | |
tree | 864f4a200219fc8c9cda2a41a9e3be3eb8f278b7 | |
parent | 262898ae43fa223916cfa27b0de81e5d9f3fc4b0 (diff) |
patch 8.2.4122: ":command Cmd" does not show custom completion argumentv8.2.4122
Problem: ":command Cmd" does not show custom completion argument.
Solution: Show the completion argument when using ":verbose".
-rw-r--r-- | src/testdir/test_usercommands.vim | 4 | ||||
-rw-r--r-- | src/usercmd.c | 7 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/testdir/test_usercommands.vim b/src/testdir/test_usercommands.vim index 808a2c7d8c..b3ba620698 100644 --- a/src/testdir/test_usercommands.vim +++ b/src/testdir/test_usercommands.vim @@ -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')) diff --git a/src/usercmd.c b/src/usercmd.c index 70f45aab81..808d36c416 100644 --- a/src/usercmd.c +++ b/src/usercmd.c @@ -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; } diff --git a/src/version.c b/src/version.c index bc75522484..bee41fdedf 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4122, +/**/ 4121, /**/ 4120, |