diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-06-02 15:28:15 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-06-02 15:28:15 +0200 |
commit | 0f37e3561db95b0ef0b636588bbd30297e377384 (patch) | |
tree | 77106af00fa3c877b7611d90741f399d9118396e | |
parent | a2e468fcac7523ae6a0ab65db5196684801fa2d1 (diff) | |
download | vim-git-0f37e3561db95b0ef0b636588bbd30297e377384.tar.gz |
patch 8.2.2925: Vim9: line continuation comment uses legacy syntaxv8.2.2925
Problem: Vim9: line continuation comment uses legacy syntax.
Solution: Check for #\ instead of "\. (closes #8295)
-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, |