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:
@@ -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 */
|
||||||
|
@@ -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()
|
||||||
|
@@ -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,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user