forked from qt-creator/qt-creator
C++ indenter: Enable class, struct, enum, namespace, using in functions.
Fixes incorrect indentation we got previously when they were used in a statement context.
This commit is contained in:
@@ -42,6 +42,7 @@ private Q_SLOTS:
|
||||
void operatorOverloads();
|
||||
void gnuStyle();
|
||||
void whitesmithsStyle();
|
||||
void singleLineEnum();
|
||||
};
|
||||
|
||||
struct Line {
|
||||
@@ -755,6 +756,19 @@ void tst_CodeFormatter::whitesmithsStyle()
|
||||
checkIndent(data, 2);
|
||||
}
|
||||
|
||||
void tst_CodeFormatter::singleLineEnum()
|
||||
{
|
||||
enum { a, b};
|
||||
QList<Line> data;
|
||||
data << Line("enum { foo, bar, car = 2 };")
|
||||
<< Line("void blah() {")
|
||||
<< Line(" enum { foo, bar, car = 2 };")
|
||||
<< Line(" int i;")
|
||||
<< Line("}")
|
||||
;
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_CodeFormatter)
|
||||
#include "tst_codeformatter.moc"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user