Problem: ":e#" does not give a warning for missing white space.
Solution: Adjust the check for white space. (closes #7545)
#ifdef FEAT_EVAL
if (eap->cmdidx != CMD_SIZE && in_vim9script()
- && !IS_WHITE_OR_NUL(*p) && !ends_excmd(*p) && *p != '!'
+ && !IS_WHITE_OR_NUL(*p) && *p != '\n' && *p != '!'
&& (cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0)
{
semsg(_(e_command_not_followed_by_white_space_str), eap->cmd);
CheckScriptFailure([
'vim9script',
'echo# something',
- ], 'E121:')
+ ], 'E1144:')
CheckScriptFailure([
'echo "yes" # something',
], 'E121:')
CheckScriptFailure([
'vim9script',
'exe# something',
- ], 'E121:')
+ ], 'E1144:')
CheckScriptFailure([
'exe "echo" # something',
], 'E121:')
' echo "yes"',
'catch',
'endtry',
- ], 'E488:')
+ ], 'E1144:')
CheckScriptFailure([
'vim9script',
'try# comment',
'echo "yes"',
- ], 'E488:')
+ ], 'E1144:')
CheckDefFailure([
'try',
' throw#comment',
'catch',
'endtry',
- ], 'E1143:')
+ ], 'E1144:')
CheckDefFailure([
'try',
' throw "yes"#comment',
' echo "yes"',
'catch# comment',
'endtry',
- ], 'E488:')
+ ], 'E1144:')
CheckScriptFailure([
'vim9script',
'try',
' echo "yes"',
'catch# comment',
'endtry',
- ], 'E654:')
+ ], 'E1144:')
CheckDefFailure([
'try',
' echo "yes"',
'echo "yes"',
'catch',
'endtry# comment',
- ], 'E488:')
+ ], 'E1144:')
CheckScriptFailure([
'vim9script',
'try',
' echo "yes"',
'catch',
'endtry# comment',
- ], 'E488:')
+ ], 'E1144:')
CheckScriptSuccess([
'vim9script',
CheckScriptFailure([
'vim9script',
'hi# comment',
- ], 'E416:')
+ ], 'E1144:')
CheckScriptSuccess([
'vim9script',
'hi Search # comment',
CheckScriptFailure([
'vim9script',
'match# comment',
- ], 'E475:')
+ ], 'E1144:')
CheckScriptSuccess([
'vim9script',
'match none # comment',
'vim9script',
'command Echo echo# comment',
'Echo',
- ], 'E121:')
+ ], 'E1144:')
delcommand Echo
var curdir = getcwd()
CheckScriptFailure([
'vim9script',
'function# comment',
- ], 'E129:')
+ ], 'E1144:')
CheckScriptSuccess([
'vim9script',
'function CheckScriptSuccess # comment',
CheckScriptFailure([
'vim9script',
'gui#comment'
- ], 'E499:')
+ ], 'E1144:')
CheckScriptFailure([
'vim9script',
'gui -f#comment'
exit_cb: Func})
END
CheckDefAndScriptFailure(lines, 'E1144:', 1)
+
+ lines =<< trim END
+ e#
+ END
+ CheckDefAndScriptFailure(lines, 'E1144:', 1)
enddef
def Test_script_var_gone_when_sourced_twice()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2214,
/**/
2213,
/**/