1
0
forked from aniani/vim

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:
Bram Moolenaar
2017-11-12 15:36:38 +01:00
parent 80eaddd3a0
commit f8c53d3d26
4 changed files with 20 additions and 1 deletions

View File

@@ -2280,7 +2280,7 @@ findmatchlimit(
{ {
/* /*
* A comment may contain / * or / /, it may also start or end * 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) if (pos.col == 0)
continue; continue;
@@ -2306,6 +2306,7 @@ findmatchlimit(
} }
else if ( linep[pos.col - 1] == '/' else if ( linep[pos.col - 1] == '/'
&& linep[pos.col] == '*' && linep[pos.col] == '*'
&& (pos.col == 1 || linep[pos.col - 2] != '*')
&& (int)pos.col < comment_col) && (int)pos.col < comment_col)
{ {
count++; count++;

View File

@@ -2338,6 +2338,16 @@ CCC
CCC CCC
#define CNT \ #define CNT \
1 + \
2 + \
4
/* end of define */
STARTTEST
:set cin cino&
/a = second
ox
ENDTEST
{ {
a = second/*bug*/*line; a = second/*bug*/*line;

View File

@@ -2094,3 +2094,9 @@ JSEND
4 4
/* end of define */ /* end of define */
{
a = second/*bug*/*line;
x
}

View File

@@ -761,6 +761,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 */
/**/
1291,
/**/ /**/
1290, 1290,
/**/ /**/