CppEditor: Fix indentation of function call arguments

... following an argument with an array subscript operator.

Fixes: QTCREATORBUG-29225
Change-Id: Iba38043d94be718efee30ce50f5b55aac4ba6ecd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2024-02-26 15:13:28 +01:00
parent 3f692e2f17
commit e43fde322e
2 changed files with 15 additions and 1 deletions

View File

@@ -107,6 +107,7 @@ private Q_SLOTS:
void shiftWithinInitializer();
void lambdaWithReturnType();
void structuredBinding();
void subscriptOperatorInFunctionCall();
};
struct Line {
@@ -2199,6 +2200,19 @@ void tst_CodeFormatter::structuredBinding()
checkIndent(data);
}
void tst_CodeFormatter::subscriptOperatorInFunctionCall()
{
QList<Line> data;
data << Line("int main() {")
<< Line(" func(array[0],")
<< Line(" ~ 0);")
<< Line(" func(array[i],")
<< Line(" ~ i);")
<< Line("}")
;
checkIndent(data);
}
QTEST_GUILESS_MAIN(tst_CodeFormatter)
#include "tst_codeformatter.moc"