if ((STRNCMP(cmd, "++nested", 8) == 0 && VIM_ISWHITE(cmd[8])))
{
if (nested)
+ {
semsg(_(e_duplicate_argument_str), "++nested");
+ return;
+ }
nested = TRUE;
cmd = skipwhite(cmd + 8);
}
- // Check for the old "nested" flag.
+ // Check for the old "nested" flag in legacy script.
if (STRNCMP(cmd, "nested", 6) == 0 && VIM_ISWHITE(cmd[6]))
{
+ if (in_vim9script())
+ {
+ // If there ever is a :nested command this error should
+ // be removed and "nested" accepted as the start of the
+ // command.
+ emsg(_(e_invalid_command_nested_did_you_mean_plusplus_nested));
+ return;
+ }
if (nested)
+ {
semsg(_(e_duplicate_argument_str), "nested");
+ return;
+ }
nested = TRUE;
cmd = skipwhite(cmd + 6);
}
# endif
EXTERN char e_missing_argument_type_for_str[]
INIT(= N_("E1077: Missing argument type for %s"));
-// E1078 unused
+#endif
+EXTERN char e_invalid_command_nested_did_you_mean_plusplus_nested[]
+ INIT(= N_("E1078: Invalid command \"nested\", did you mean \"++nested\"?"));
+#ifdef FEAT_EVAL
EXTERN char e_cannot_declare_variable_on_command_line[]
INIT(= N_("E1079: Cannot declare a variable on the command line"));
EXTERN char e_invalid_assignment[]