Adjust indentation when the line starts or ends with <<

This commit is contained in:
Peter Vingelmann 2016-09-19 20:04:20 +02:00
parent 575c2d2e1f
commit 008cc94a1e

View File

@ -3563,9 +3563,19 @@ void ASBeautifier::parseCurrentLine(const string& line)
{ {
// this will be true if the line begins with the operator // this will be true if the line begins with the operator
if (i < 2 && spaceIndentCount == 0) if (i < 2 && spaceIndentCount == 0)
spaceIndentCount += 2 * indentLength; spaceIndentCount += indentLength;
// align to the beginning column of the operator // check if the line ends with << or >>
registerInStatementIndent(line, i - foundNonAssignmentOp->length(), spaceIndentCount, tabIncrementIn, 0, false); if (line.find_first_not_of(" \t", i + 1) == string::npos)
{
// this will only add one indentation from the left
registerInStatementIndent(line, i, spaceIndentCount, tabIncrementIn, 0, false);
}
else
{
// align to the beginning column of the operator
registerInStatementIndent(line, i - foundNonAssignmentOp->length(),
spaceIndentCount, tabIncrementIn, 0, false);
}
} }
} }