# HG changeset patch # User Bram Moolenaar # Date 1587070804 -7200 # Node ID 6e6a758008849c35d108266ef71b9e82b545ab1d # Parent 324f7433a2c4fcc16c902f432d90aec3469f1591 patch 8.2.0586: Vim9: # comment not sufficiently tested Commit: https://github.com/vim/vim/commit/4a8d9f2ed8c0079732e35d72656a000641353b94 Author: Bram Moolenaar Date: Thu Apr 16 22:54:32 2020 +0200 patch 8.2.0586: Vim9: # comment not sufficiently tested Problem: Vim9: # comment not sufficiently tested Solution: Check for preceding white space. diff --git a/src/eval.c b/src/eval.c --- a/src/eval.c +++ b/src/eval.c @@ -6143,7 +6143,7 @@ ex_execute(exarg_T *eap) if (eap->skip) ++emsg_skip; - while (*arg != NUL && *arg != '|' && *arg != '\n') + while (!ends_excmd2(eap->cmd, arg) || *arg == '"') { ret = eval1_emsg(&arg, &rettv, !eap->skip); if (ret == FAIL) diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1025,6 +1025,20 @@ def Test_vim9_comment() ':# something', ], 'E488:') + { # block start + } # block end + CheckDefFailure([ + '{# comment', + ], 'E488:') + CheckDefFailure([ + '{', + '}# comment', + ], 'E488:') + + echo "yes" # comment + CheckDefFailure([ + 'echo "yes"# comment', + ], 'E488:') CheckScriptSuccess([ 'vim9script', 'echo "yes" # something', @@ -1041,6 +1055,29 @@ def Test_vim9_comment() 'echo "yes" # something', ], 'E121:') + exe "echo" # comment + CheckDefFailure([ + 'exe "echo"# comment', + ], 'E488:') + CheckScriptSuccess([ + 'vim9script', + 'exe "echo" # something', + ]) + CheckScriptFailure([ + 'vim9script', + 'exe "echo"# something', + ], 'E121:') + CheckDefFailure([ + 'exe # comment', + ], 'E1015:') + CheckScriptFailure([ + 'vim9script', + 'exe# something', + ], 'E121:') + CheckScriptFailure([ + 'exe "echo" # something', + ], 'E121:') + CheckDefFailure([ 'try# comment', 'echo "yes"', diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 586, +/**/ 585, /**/ 584,