diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2010-07-08 13:07:32 +0200 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2010-07-08 13:08:03 +0200 |
commit | c8fae1122216b66f16e15aa5a5527ddf613aac26 (patch) | |
tree | c4e49ac8f417d56191b507ed055c6d25d53d8361 /src/plugins/cpptools/cppcodeformatter.cpp | |
parent | aaf2912857ea2e8e08411e26366724c492ba40df (diff) | |
download | qt-creator-c8fae1122216b66f16e15aa5a5527ddf613aac26.tar.gz |
C++ indenter: Fix for extending if conditions.
Task-number: QTCREATORBUG-1825
Diffstat (limited to 'src/plugins/cpptools/cppcodeformatter.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcodeformatter.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp index f0288538a1..45c79e783e 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) { |