forked from qt-creator/qt-creator
QmlJS indenter: Fix ternary multiline indent.
Task-number: QTCREATORBUG-6208 Change-Id: I7e5267291bc01226b5339cb4abdbb15856c58477 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
@@ -139,18 +139,15 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd
|
||||
if (*indentDepth == tokenPosition) {
|
||||
// expression_or_objectdefinition doesn't want the indent
|
||||
// expression_or_label already has it
|
||||
// ternary already adjusts indents nicely
|
||||
if (parentState.type != expression_or_objectdefinition
|
||||
&& parentState.type != expression_or_label
|
||||
&& parentState.type != binding_assignment
|
||||
&& parentState.type != ternary_op) {
|
||||
&& parentState.type != binding_assignment) {
|
||||
*indentDepth += 2*m_indentSize;
|
||||
}
|
||||
}
|
||||
// expression_or_objectdefinition and expression_or_label have already consumed the first token
|
||||
else if (parentState.type != expression_or_objectdefinition
|
||||
&& parentState.type != expression_or_label
|
||||
&& parentState.type != ternary_op) {
|
||||
&& parentState.type != expression_or_label) {
|
||||
*indentDepth = tokenPosition;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user