From b1259192ff10a488703ce37343e60e83b44bda13 Mon Sep 17 00:00:00 2001 From: Peter Vingelmann Date: Thu, 15 Sep 2016 02:07:08 +0200 Subject: [PATCH] Do not try to align multiple assignments if line ends with comma --- src/ASBeautifier.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/ASBeautifier.cpp b/src/ASBeautifier.cpp index 97d35a0..9eaf53f 100644 --- a/src/ASBeautifier.cpp +++ b/src/ASBeautifier.cpp @@ -2347,7 +2347,6 @@ void ASBeautifier::parseCurrentLine(const string& line) bool isInOperator = false; bool isSpecialChar = false; bool haveCaseIndent = false; - bool haveAssignmentThisLine = false; bool closingBracketReached = false; bool previousLineProbation = (probationHeader != NULL); char ch = ' '; @@ -3514,23 +3513,8 @@ void ASBeautifier::parseCurrentLine(const string& line) if (!isInOperator && !isInTemplate && (!isNonInStatementArray || isInEnum)) { - // if multiple assignments, align on the previous word - if (foundAssignmentOp == &AS_ASSIGN - && prevNonSpaceCh != ']' // an array - && statementEndsWithComma(line, i)) - { - if (!haveAssignmentThisLine) // only one assignment indent per line - { - // register indent at previous word - haveAssignmentThisLine = true; - int prevWordIndex = getInStatementIndentAssign(line, i); - int inStatementIndent = prevWordIndex + spaceIndentCount + tabIncrementIn; - inStatementIndentStack->push_back(inStatementIndent); - isInStatement = true; - } - } // don't indent an assignment if 'let' - else if (isInLet) + if (isInLet) { isInLet = false; }