diff options
-rw-r--r-- | src/scriptfile.c | 3 | ||||
-rw-r--r-- | src/testdir/test_vim9_script.vim | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 22 insertions, 1 deletions
diff --git a/src/scriptfile.c b/src/scriptfile.c index 203cad09f..15338be63 100644 --- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -1842,7 +1842,8 @@ getsourceline( ga_concat(&ga, p); } } - else if (!(p[0] == '"' && p[1] == '\\' && p[2] == ' ') + else if (!(p[0] == (in_vim9script() ? '#' : '"') + && p[1] == '\\' && p[2] == ' ') && !(do_vim9_all && (*p == NUL || vim9_comment_start(p)))) break; /* drop a # comment or "\ comment line */ diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index cdda61321..ee324950f 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -3074,6 +3074,24 @@ def Test_vim9_comment() 'func Test() # comment', 'endfunc', ], 'E488:') + + var lines =<< trim END + vim9script + syn region Text + \ start='foo' + #\ comment + \ end='bar' + END + CheckScriptSuccess(lines) + + lines =<< trim END + vim9script + syn region Text + \ start='foo' + "\ comment + \ end='bar' + END + CheckScriptFailure(lines, 'E399:') enddef def Test_vim9_comment_gui() diff --git a/src/version.c b/src/version.c index aaf27c142..188bb1a88 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 */ /**/ + 2925, +/**/ 2924, /**/ 2923, |