Skip to content

Commit 4ba24fb

Browse files
committed
use apply line adjustment when calling SmartIndenter
1 parent edd35f0 commit 4ba24fb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/services/formatting/format.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,10 @@ module ts.formatting {
237237

238238
// determine child indentation
239239
// TODO: share this code with SmartIndenter
240+
// NOTE: SI uses non-adjusted lines
240241
var increaseIndentation =
241242
childStartLine !== nodeStartLine &&
242-
!SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(node, child, childStartLine, sourceFile) &&
243+
!SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(node, child, childStartLine + 1, sourceFile) &&
243244
SmartIndenter.shouldIndentChildNode(node, child);
244245

245246
processNode(child, childContextNode, childStartLine, increaseIndentation ? indentation + options.IndentSize : indentation);

0 commit comments

Comments
 (0)