Adjust indentation when the line starts or ends with <<
This commit is contained in:
parent
575c2d2e1f
commit
008cc94a1e
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user