forked from qt-creator/qt-creator
C++ indenter: Improve member initializer indent.
If you indent the first initializer differently, that will now stick for the following ones. Change-Id: Ib08dfbf64282eda41202528b7255e693c350f7c6 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
@@ -83,6 +83,8 @@ private Q_SLOTS:
|
||||
void switch5();
|
||||
void blocks();
|
||||
void memberInitializer();
|
||||
void memberInitializer2();
|
||||
void memberInitializer3();
|
||||
void templates();
|
||||
void operatorOverloads();
|
||||
void gnuStyle();
|
||||
@@ -1097,6 +1099,62 @@ void tst_CodeFormatter::memberInitializer()
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
void tst_CodeFormatter::memberInitializer2()
|
||||
{
|
||||
QList<Line> data;
|
||||
data << Line("void foo()")
|
||||
<< Line("~ : foo()")
|
||||
<< Line("~ , foo()")
|
||||
<< Line("~ , foo()")
|
||||
<< Line("{}")
|
||||
<< Line("void foo()")
|
||||
<< Line("~ : foo()", 0, 4)
|
||||
<< Line("~ , foo()")
|
||||
<< Line("~ , foo()")
|
||||
<< Line("{}")
|
||||
<< Line("void foo()")
|
||||
<< Line("~ : foo(),")
|
||||
<< Line("~ foo(),")
|
||||
<< Line("~ foo()")
|
||||
<< Line("{}")
|
||||
<< Line("void foo()")
|
||||
<< Line("~ : foo(),", 0, 4)
|
||||
<< Line("~ foo(),")
|
||||
<< Line("~ foo()")
|
||||
<< Line("{}")
|
||||
<< Line("void foo()")
|
||||
<< Line("~ :")
|
||||
<< Line("~ foo(),")
|
||||
<< Line("~ foo(),")
|
||||
<< Line("~ foo()")
|
||||
<< Line("{}")
|
||||
<< Line("void foo()")
|
||||
<< Line("~ :")
|
||||
<< Line("~ foo(),", 0, 6)
|
||||
<< Line("~ foo(),")
|
||||
<< Line("~ foo()")
|
||||
<< Line("{}")
|
||||
;
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
void tst_CodeFormatter::memberInitializer3()
|
||||
{
|
||||
QList<Line> data;
|
||||
data << Line("void foo() :")
|
||||
<< Line("~ foo(),")
|
||||
<< Line("~ foo(),")
|
||||
<< Line("~ foo()")
|
||||
<< Line("{}")
|
||||
<< Line("void foo() :")
|
||||
<< Line("~ foo(),", 0, 4)
|
||||
<< Line("~ foo(),")
|
||||
<< Line("~ foo()")
|
||||
<< Line("{}")
|
||||
;
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
void tst_CodeFormatter::templates()
|
||||
{
|
||||
QList<Line> data;
|
||||
|
||||
Reference in New Issue
Block a user