Commit c8fae112 authored by Christian Kamm's avatar Christian Kamm
Browse files

C++ indenter: Fix for extending if conditions.

Task-number: QTCREATORBUG-1825
parent aaf29128
......@@ -1194,11 +1194,13 @@ void QtStyleCodeFormatter::adjustIndent(const QList<CPlusPlus::Token> &tokens, i
}
break;
}
case T_RPAREN:
if (topState.type == condition_open) {
*indentDepth = previousState.savedIndentDepth;
}
break;
// Disabled for now, see QTCREATORBUG-1825. It makes extending if conditions
// awkward: inserting a newline just before the ) shouldn't align to 'if'.
//case T_RPAREN:
// if (topState.type == condition_open) {
// *indentDepth = previousState.savedIndentDepth;
// }
// break;
case T_DEFAULT:
case T_CASE:
for (int i = 0; state(i).type != topmost_intro; ++i) {
......
......@@ -266,7 +266,7 @@ void tst_CodeFormatter::ifStatementLongCondition()
<< Line(" || (a + b > 4")
<< Line(" && foo(bar)")
<< Line(" )")
<< Line(" ) {")
<< Line(" ) {")
<< Line(" foo;")
<< Line(" }")
<< Line("}");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment