mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.2214: ":e#" does not give a warning for missing white space
Problem: ":e#" does not give a warning for missing white space. Solution: Adjust the check for white space. (closes #7545)
This commit is contained in:
@@ -3532,7 +3532,7 @@ find_ex_command(
|
|||||||
|
|
||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
if (eap->cmdidx != CMD_SIZE && in_vim9script()
|
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)
|
&& (cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0)
|
||||||
{
|
{
|
||||||
semsg(_(e_command_not_followed_by_white_space_str), eap->cmd);
|
semsg(_(e_command_not_followed_by_white_space_str), eap->cmd);
|
||||||
|
@@ -2132,7 +2132,7 @@ def Test_vim9_comment()
|
|||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'echo# something',
|
'echo# something',
|
||||||
], 'E121:')
|
], 'E1144:')
|
||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'echo "yes" # something',
|
'echo "yes" # something',
|
||||||
], 'E121:')
|
], 'E121:')
|
||||||
@@ -2152,7 +2152,7 @@ def Test_vim9_comment()
|
|||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'exe# something',
|
'exe# something',
|
||||||
], 'E121:')
|
], 'E1144:')
|
||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'exe "echo" # something',
|
'exe "echo" # something',
|
||||||
], 'E121:')
|
], 'E121:')
|
||||||
@@ -2162,18 +2162,18 @@ def Test_vim9_comment()
|
|||||||
' echo "yes"',
|
' echo "yes"',
|
||||||
'catch',
|
'catch',
|
||||||
'endtry',
|
'endtry',
|
||||||
], 'E488:')
|
], 'E1144:')
|
||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'try# comment',
|
'try# comment',
|
||||||
'echo "yes"',
|
'echo "yes"',
|
||||||
], 'E488:')
|
], 'E1144:')
|
||||||
CheckDefFailure([
|
CheckDefFailure([
|
||||||
'try',
|
'try',
|
||||||
' throw#comment',
|
' throw#comment',
|
||||||
'catch',
|
'catch',
|
||||||
'endtry',
|
'endtry',
|
||||||
], 'E1143:')
|
], 'E1144:')
|
||||||
CheckDefFailure([
|
CheckDefFailure([
|
||||||
'try',
|
'try',
|
||||||
' throw "yes"#comment',
|
' throw "yes"#comment',
|
||||||
@@ -2185,14 +2185,14 @@ def Test_vim9_comment()
|
|||||||
' echo "yes"',
|
' echo "yes"',
|
||||||
'catch# comment',
|
'catch# comment',
|
||||||
'endtry',
|
'endtry',
|
||||||
], 'E488:')
|
], 'E1144:')
|
||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'try',
|
'try',
|
||||||
' echo "yes"',
|
' echo "yes"',
|
||||||
'catch# comment',
|
'catch# comment',
|
||||||
'endtry',
|
'endtry',
|
||||||
], 'E654:')
|
], 'E1144:')
|
||||||
CheckDefFailure([
|
CheckDefFailure([
|
||||||
'try',
|
'try',
|
||||||
' echo "yes"',
|
' echo "yes"',
|
||||||
@@ -2204,14 +2204,14 @@ def Test_vim9_comment()
|
|||||||
'echo "yes"',
|
'echo "yes"',
|
||||||
'catch',
|
'catch',
|
||||||
'endtry# comment',
|
'endtry# comment',
|
||||||
], 'E488:')
|
], 'E1144:')
|
||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'try',
|
'try',
|
||||||
' echo "yes"',
|
' echo "yes"',
|
||||||
'catch',
|
'catch',
|
||||||
'endtry# comment',
|
'endtry# comment',
|
||||||
], 'E488:')
|
], 'E1144:')
|
||||||
|
|
||||||
CheckScriptSuccess([
|
CheckScriptSuccess([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
@@ -2220,7 +2220,7 @@ def Test_vim9_comment()
|
|||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'hi# comment',
|
'hi# comment',
|
||||||
], 'E416:')
|
], 'E1144:')
|
||||||
CheckScriptSuccess([
|
CheckScriptSuccess([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'hi Search # comment',
|
'hi Search # comment',
|
||||||
@@ -2266,7 +2266,7 @@ def Test_vim9_comment()
|
|||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'match# comment',
|
'match# comment',
|
||||||
], 'E475:')
|
], 'E1144:')
|
||||||
CheckScriptSuccess([
|
CheckScriptSuccess([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'match none # comment',
|
'match none # comment',
|
||||||
@@ -2402,7 +2402,7 @@ def Test_vim9_comment()
|
|||||||
'vim9script',
|
'vim9script',
|
||||||
'command Echo echo# comment',
|
'command Echo echo# comment',
|
||||||
'Echo',
|
'Echo',
|
||||||
], 'E121:')
|
], 'E1144:')
|
||||||
delcommand Echo
|
delcommand Echo
|
||||||
|
|
||||||
var curdir = getcwd()
|
var curdir = getcwd()
|
||||||
@@ -2447,7 +2447,7 @@ def Test_vim9_comment()
|
|||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'function# comment',
|
'function# comment',
|
||||||
], 'E129:')
|
], 'E1144:')
|
||||||
CheckScriptSuccess([
|
CheckScriptSuccess([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'function CheckScriptSuccess # comment',
|
'function CheckScriptSuccess # comment',
|
||||||
@@ -2516,7 +2516,7 @@ def Test_vim9_comment_gui()
|
|||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'gui#comment'
|
'gui#comment'
|
||||||
], 'E499:')
|
], 'E1144:')
|
||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'vim9script',
|
'vim9script',
|
||||||
'gui -f#comment'
|
'gui -f#comment'
|
||||||
@@ -3124,6 +3124,11 @@ def Test_white_space_after_command()
|
|||||||
exit_cb: Func})
|
exit_cb: Func})
|
||||||
END
|
END
|
||||||
CheckDefAndScriptFailure(lines, 'E1144:', 1)
|
CheckDefAndScriptFailure(lines, 'E1144:', 1)
|
||||||
|
|
||||||
|
lines =<< trim END
|
||||||
|
e#
|
||||||
|
END
|
||||||
|
CheckDefAndScriptFailure(lines, 'E1144:', 1)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_script_var_gone_when_sourced_twice()
|
def Test_script_var_gone_when_sourced_twice()
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2214,
|
||||||
/**/
|
/**/
|
||||||
2213,
|
2213,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user