use apply line adjustment when calling SmartIndenter

This commit is contained in:
Vladimir Matveev 2014-10-22 16:01:43 -07:00
parent edd35f01ca
commit 4ba24fb7d4

View File

@ -237,9 +237,10 @@ module ts.formatting {
// determine child indentation
// TODO: share this code with SmartIndenter
// NOTE: SI uses non-adjusted lines
var increaseIndentation =
childStartLine !== nodeStartLine &&
!SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(node, child, childStartLine, sourceFile) &&
!SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(node, child, childStartLine + 1, sourceFile) &&
SmartIndenter.shouldIndentChildNode(node, child);
processNode(child, childContextNode, childStartLine, increaseIndentation ? indentation + options.IndentSize : indentation);