1
0
forked from aniani/vim

patch 8.2.2925: Vim9: line continuation comment uses legacy syntax

Problem:    Vim9: line continuation comment uses legacy syntax.
Solution:   Check for #\ instead of "\. (closes #8295)
This commit is contained in:
Bram Moolenaar
2021-06-02 15:28:15 +02:00
parent a2e468fcac
commit 0f37e3561d
3 changed files with 22 additions and 1 deletions

View File

@@ -1842,7 +1842,8 @@ getsourceline(
ga_concat(&ga, p); 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)))) && !(do_vim9_all && (*p == NUL || vim9_comment_start(p))))
break; break;
/* drop a # comment or "\ comment line */ /* drop a # comment or "\ comment line */

View File

@@ -3074,6 +3074,24 @@ def Test_vim9_comment()
'func Test() # comment', 'func Test() # comment',
'endfunc', 'endfunc',
], 'E488:') ], '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 enddef
def Test_vim9_comment_gui() def Test_vim9_comment_gui()

View File

@@ -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 */
/**/
2925,
/**/ /**/
2924, 2924,
/**/ /**/