mirror of
https://github.com/vim/vim.git
synced 2025-09-06 21:53:38 -04:00
patch 8.0.1291: C indent wrong when * immediately follows comment
Problem: C indent wrong when * immediately follows comment. (John Bowler) Solution: Do not see "/*" after "*" as a comment start. (closes #2321)
This commit is contained in:
parent
80eaddd3a0
commit
f8c53d3d26
@ -2280,7 +2280,7 @@ findmatchlimit(
|
||||
{
|
||||
/*
|
||||
* A comment may contain / * or / /, it may also start or end
|
||||
* with / * /. Ignore a / * after / /.
|
||||
* with / * /. Ignore a / * after / / and after *.
|
||||
*/
|
||||
if (pos.col == 0)
|
||||
continue;
|
||||
@ -2306,6 +2306,7 @@ findmatchlimit(
|
||||
}
|
||||
else if ( linep[pos.col - 1] == '/'
|
||||
&& linep[pos.col] == '*'
|
||||
&& (pos.col == 1 || linep[pos.col - 2] != '*')
|
||||
&& (int)pos.col < comment_col)
|
||||
{
|
||||
count++;
|
||||
|
@ -2338,6 +2338,16 @@ CCC
|
||||
4
|
||||
/* end of define */
|
||||
|
||||
STARTTEST
|
||||
:set cin cino&
|
||||
/a = second
|
||||
ox
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
a = second/*bug*/*line;
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
:g/^STARTTEST/.,/^ENDTEST/d
|
||||
:1;/start of AUTO/,$wq! test.out
|
||||
|
@ -2094,3 +2094,9 @@ JSEND
|
||||
4
|
||||
/* end of define */
|
||||
|
||||
|
||||
{
|
||||
a = second/*bug*/*line;
|
||||
x
|
||||
}
|
||||
|
||||
|
@ -761,6 +761,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1291,
|
||||
/**/
|
||||
1290,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user