From 4ba24fb7d4e4a86966b9ff7bc1c38c4a48345eee Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 22 Oct 2014 16:01:43 -0700 Subject: [PATCH] use apply line adjustment when calling SmartIndenter --- src/services/formatting/format.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/formatting/format.ts b/src/services/formatting/format.ts index 2cd94486832..cdd7c135a0c 100644 --- a/src/services/formatting/format.ts +++ b/src/services/formatting/format.ts @@ -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);