diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-12-25 17:36:27 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-12-25 17:36:27 +0100 |
commit | f8103f274e828bdc2dcbc4d857f166f25e0a855e (patch) | |
tree | 1b32ee2924c95ec74e740f8e70c1b62e3f505447 /src | |
parent | 7cfcd0c99c485a973d8cbff939531e430ad77f55 (diff) | |
download | vim-git-f8103f274e828bdc2dcbc4d857f166f25e0a855e.tar.gz |
patch 8.2.2214: ":e#" does not give a warning for missing white spacev8.2.2214
Problem: ":e#" does not give a warning for missing white space.
Solution: Adjust the check for white space. (closes #7545)
Diffstat (limited to 'src')
-rw-r--r-- | src/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/testdir/test_vim9_script.vim | 33 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 22 insertions, 15 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index b1dcc6f0d..3bb3d4968 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3532,7 +3532,7 @@ find_ex_command( #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); diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 607c0cb61..1e64daaec 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -2132,7 +2132,7 @@ def Test_vim9_comment() CheckScriptFailure([ 'vim9script', 'echo# something', - ], 'E121:') + ], 'E1144:') CheckScriptFailure([ 'echo "yes" # something', ], 'E121:') @@ -2152,7 +2152,7 @@ def Test_vim9_comment() CheckScriptFailure([ 'vim9script', 'exe# something', - ], 'E121:') + ], 'E1144:') CheckScriptFailure([ 'exe "echo" # something', ], 'E121:') @@ -2162,18 +2162,18 @@ def Test_vim9_comment() ' 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', @@ -2185,14 +2185,14 @@ def Test_vim9_comment() ' echo "yes"', 'catch# comment', 'endtry', - ], 'E488:') + ], 'E1144:') CheckScriptFailure([ 'vim9script', 'try', ' echo "yes"', 'catch# comment', 'endtry', - ], 'E654:') + ], 'E1144:') CheckDefFailure([ 'try', ' echo "yes"', @@ -2204,14 +2204,14 @@ def Test_vim9_comment() 'echo "yes"', 'catch', 'endtry# comment', - ], 'E488:') + ], 'E1144:') CheckScriptFailure([ 'vim9script', 'try', ' echo "yes"', 'catch', 'endtry# comment', - ], 'E488:') + ], 'E1144:') CheckScriptSuccess([ 'vim9script', @@ -2220,7 +2220,7 @@ def Test_vim9_comment() CheckScriptFailure([ 'vim9script', 'hi# comment', - ], 'E416:') + ], 'E1144:') CheckScriptSuccess([ 'vim9script', 'hi Search # comment', @@ -2266,7 +2266,7 @@ def Test_vim9_comment() CheckScriptFailure([ 'vim9script', 'match# comment', - ], 'E475:') + ], 'E1144:') CheckScriptSuccess([ 'vim9script', 'match none # comment', @@ -2402,7 +2402,7 @@ def Test_vim9_comment() 'vim9script', 'command Echo echo# comment', 'Echo', - ], 'E121:') + ], 'E1144:') delcommand Echo var curdir = getcwd() @@ -2447,7 +2447,7 @@ def Test_vim9_comment() CheckScriptFailure([ 'vim9script', 'function# comment', - ], 'E129:') + ], 'E1144:') CheckScriptSuccess([ 'vim9script', 'function CheckScriptSuccess # comment', @@ -2516,7 +2516,7 @@ def Test_vim9_comment_gui() CheckScriptFailure([ 'vim9script', 'gui#comment' - ], 'E499:') + ], 'E1144:') CheckScriptFailure([ 'vim9script', 'gui -f#comment' @@ -3124,6 +3124,11 @@ def Test_white_space_after_command() 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() diff --git a/src/version.c b/src/version.c index 2a85bb326..ff9652356 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2214, +/**/ 2213, /**/ 2212, |