Permalink
Browse files

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)
  • Loading branch information...
brammool committed Nov 12, 2017
1 parent 80eaddd commit f8c53d3d268fc67a29c8c1a4e76fae85762e11b5
Showing with 20 additions and 1 deletion.
  1. +2 −1 src/search.c
  2. +10 −0 src/testdir/test3.in
  3. +6 −0 src/testdir/test3.ok
  4. +2 −0 src/version.c
View
@@ -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++;
View
@@ -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
View
@@ -2094,3 +2094,9 @@ JSEND
4
/* end of define */
{
a = second/*bug*/*line;
x
}
View
@@ -761,6 +761,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1291,
/**/
1290,
/**/

0 comments on commit f8c53d3

Please sign in to comment.