C++ indenter: Fix for extending if conditions.

Task-number: QTCREATORBUG-1825
This commit is contained in:
Christian Kamm
2010-07-08 13:07:32 +02:00
parent aaf2912857
commit c8fae11222
2 changed files with 8 additions and 6 deletions

View File

@@ -1194,11 +1194,13 @@ void QtStyleCodeFormatter::adjustIndent(const QList<CPlusPlus::Token> &tokens, i
} }
break; break;
} }
case T_RPAREN: // Disabled for now, see QTCREATORBUG-1825. It makes extending if conditions
if (topState.type == condition_open) { // awkward: inserting a newline just before the ) shouldn't align to 'if'.
*indentDepth = previousState.savedIndentDepth; //case T_RPAREN:
} // if (topState.type == condition_open) {
break; // *indentDepth = previousState.savedIndentDepth;
// }
// break;
case T_DEFAULT: case T_DEFAULT:
case T_CASE: case T_CASE:
for (int i = 0; state(i).type != topmost_intro; ++i) { for (int i = 0; state(i).type != topmost_intro; ++i) {