Mercurial > vim
diff src/usercmd.c @ 25210:8d816c266ceb v8.2.3141
patch 8.2.3141: no error when using :complete for :command without -nargs
Commit: https://github.com/vim/vim/commit/de69a7353e9bec552e15dbe3706a9f4e88080fce
Author: Martin Tournoij <martin@arp242.net>
Date: Sun Jul 11 14:28:25 2021 +0200
patch 8.2.3141: no error when using :complete for :command without -nargs
Problem: No error when using :complete for :command without -nargs.
Solution: Give an error. (Martin Tournoij, closes https://github.com/vim/vim/issues/8544, closes https://github.com/vim/vim/issues/8541)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 11 Jul 2021 14:30:04 +0200 |
parents | 7334bf933510 |
children | a9ea83a3659a |
line wrap: on
line diff
--- 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);