comparison src/usercmd.c @ 25226:a9ea83a3659a v8.2.3149

patch 8.2.3149: some plugins have a problem with the error check Commit: https://github.com/vim/vim/commit/cc7eb2aa7a7f2e6ae41f1e7cf60965c083d8a9e9 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 11 19:12:04 2021 +0200 patch 8.2.3149: some plugins have a problem with the error check Problem: Some plugins have a problem with the error check for using :command with -complete but without -nargs. Solution: In legacy script only give a warning message.
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Jul 2021 19:15:03 +0200
parents 8d816c266ceb
children b80e4e9c4988
comparison
equal deleted inserted replaced
25225:2bdf399b2884 25226:a9ea83a3659a
1025 else if ((name_len == 1 && *name == 'X') 1025 else if ((name_len == 1 && *name == 'X')
1026 || (name_len <= 4 1026 || (name_len <= 4
1027 && STRNCMP(name, "Next", name_len > 4 ? 4 : name_len) == 0)) 1027 && STRNCMP(name, "Next", name_len > 4 ? 4 : name_len) == 0))
1028 emsg(_("E841: Reserved name, cannot be used for user defined command")); 1028 emsg(_("E841: Reserved name, cannot be used for user defined command"));
1029 else if (compl > 0 && (argt & EX_EXTRA) == 0) 1029 else if (compl > 0 && (argt & EX_EXTRA) == 0)
1030 emsg(_(e_complete_used_without_nargs)); 1030 {
1031 // Some plugins rely on silently ignoring the mistake, only make this
1032 // an error in Vim9 script.
1033 if (in_vim9script())
1034 emsg(_(e_complete_used_without_nargs));
1035 else
1036 give_warning_with_source(
1037 (char_u *)_(e_complete_used_without_nargs), TRUE, TRUE);
1038 }
1031 else 1039 else
1032 uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg, 1040 uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg,
1033 addr_type_arg, eap->forceit); 1041 addr_type_arg, eap->forceit);
1034 } 1042 }
1035 1043