diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp index f0288538a1f967bb1a18f4e99876c198d0800794..45c79e783ecb89a0b305902aad5d7bc3f6eba364 100644 --- a/src/plugins/cpptools/cppcodeformatter.cpp +++ b/src/plugins/cpptools/cppcodeformatter.cpp @@ -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) { diff --git a/tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp b/tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp index 3141e76002f426a3d71df4301e2a0ec361b935cb..c8216f90bacaa4e2730d4f35b0204c596a296b3c 100644 --- a/tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp +++ b/tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp @@ -266,7 +266,7 @@ void tst_CodeFormatter::ifStatementLongCondition() << Line(" || (a + b > 4") << Line(" && foo(bar)") << Line(" )") - << Line(" ) {") + << Line(" ) {") << Line(" foo;") << Line(" }") << Line("}");