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:
@@ -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++;
|
||||||
|
@@ -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;
|
||||||
|
@@ -2094,3 +2094,9 @@ JSEND
|
|||||||
4
|
4
|
||||||
/* end of define */
|
/* end of define */
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
a = second/*bug*/*line;
|
||||||
|
x
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -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,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user