diff options
author | Martin Tournoij <martin@arp242.net> | 2021-07-11 14:28:25 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-11 14:28:25 +0200 |
commit | de69a7353e9bec552e15dbe3706a9f4e88080fce (patch) | |
tree | 51eeb933d632ab9f5caeff22ff28936f4ecc288f /src/usercmd.c | |
parent | 482d2f37a5ce43157ab1e22c26f389770d0c20cf (diff) | |
download | vim-git-de69a7353e9bec552e15dbe3706a9f4e88080fce.tar.gz |
patch 8.2.3141: no error when using :complete for :command without -nargsv8.2.3141
Problem: No error when using :complete for :command without -nargs.
Solution: Give an error. (Martin Tournoij, closes #8544, closes #8541)
Diffstat (limited to 'src/usercmd.c')
-rw-r--r-- | src/usercmd.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/usercmd.c b/src/usercmd.c index a4bbfd77c..94ebb43af 100644 --- a/src/usercmd.c +++ b/src/usercmd.c @@ -1019,21 +1019,15 @@ ex_command(exarg_T *eap) // we are listing commands p = skipwhite(end); if (!has_attr && ends_excmd2(eap->arg, p)) - { uc_list(name, end - name); - } else if (!ASCII_ISUPPER(*name)) - { emsg(_("E183: User defined commands must start with an uppercase letter")); - return; - } else if ((name_len == 1 && *name == 'X') || (name_len <= 4 && STRNCMP(name, "Next", name_len > 4 ? 4 : name_len) == 0)) - { emsg(_("E841: Reserved name, cannot be used for user defined command")); - return; - } + else if (compl > 0 && (argt & EX_EXTRA) == 0) + emsg(_(e_complete_used_without_nargs)); else uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg, addr_type_arg, eap->forceit); |