0
0
mirror of https://github.com/vim/vim.git synced 2025-09-06 21:53:38 -04:00

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);
}
}
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 */

View File

@ -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()

View File

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