0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 7.4.912

Problem:    Wrong indenting for C++ constructor.
Solution:   Recognize ::.  (Anhong)
This commit is contained in:
Bram Moolenaar
2015-11-10 14:06:53 +01:00
parent 450ca4335e
commit e01f4f86ce
4 changed files with 29 additions and 0 deletions

View File

@@ -6250,6 +6250,19 @@ cin_isfuncdecl(sp, first_lnum, min_lnum)
{
if (cin_iscomment(s)) /* ignore comments */
s = cin_skipcomment(s);
else if (*s == ':')
{
if (*(s + 1) == ':')
s += 2;
else
/* To avoid a mistake in the following situation:
* A::A(int a, int b)
* : a(0) // <--not a function decl
* , b(0)
* {...
*/
return FALSE;
}
else
++s;
}

View File

@@ -663,6 +663,13 @@ Constructor::Constructor(int a,
{
}
A::A(int a, int b)
: aa(a),
bb(b),
cc(c)
{
}
class CAbc :
public BaseClass1,
protected BaseClass2

View File

@@ -651,6 +651,13 @@ Constructor::Constructor(int a,
{
}
A::A(int a, int b)
: aa(a),
bb(b),
cc(c)
{
}
class CAbc :
public BaseClass1,
protected BaseClass2

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
912,
/**/
911,
/**/