0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2931: Vim9: line continuation comment uses legacy syntax

Problem:    Vim9: line continuation comment still uses legacy syntax in one
            place.
Solution:   Check for #\ instead of "\ earlier. (closes #8316)
This commit is contained in:
Bram Moolenaar
2021-06-03 21:56:10 +02:00
parent 85eee5b969
commit 5072b47a22
3 changed files with 10 additions and 2 deletions

View File

@@ -1788,6 +1788,8 @@ getsourceline(
if (line != NULL && options != GETLINE_NONE
&& vim_strchr(p_cpo, CPO_CONCAT) == NULL)
{
int comment_char = in_vim9script() ? '#' : '"';
// compensate for the one line read-ahead
--sp->sourcing_lnum;
@@ -1800,7 +1802,8 @@ getsourceline(
sp->nextline = get_one_sourceline(sp);
if (sp->nextline != NULL
&& (*(p = skipwhite(sp->nextline)) == '\\'
|| (p[0] == '"' && p[1] == '\\' && p[2] == ' ')
|| (p[0] == comment_char
&& p[1] == '\\' && p[2] == ' ')
|| (do_vim9_all && (*p == NUL
|| vim9_comment_start(p)))
|| (do_bar_cont && p[0] == '|' && p[1] != '|')))
@@ -1842,7 +1845,7 @@ getsourceline(
ga_concat(&ga, p);
}
}
else if (!(p[0] == (in_vim9script() ? '#' : '"')
else if (!(p[0] == (comment_char)
&& p[1] == '\\' && p[2] == ' ')
&& !(do_vim9_all && (*p == NUL || vim9_comment_start(p))))
break;

View File

@@ -3081,6 +3081,9 @@ def Test_vim9_comment()
\ start='foo'
#\ comment
\ end='bar'
syn region Text start='foo'
#\ comment
\ end='bar'
END
CheckScriptSuccess(lines)

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2931,
/**/
2930,
/**/