simplified code flow

This commit is contained in:
SaschaNaz
2015-09-06 16:02:38 +09:00
parent 40f3fcf575
commit 0fc9e7e313
2 changed files with 5 additions and 8 deletions
+4 -7
View File
@@ -403,16 +403,13 @@ namespace ts.formatting {
indentation = parentDynamicIndentation.getIndentation();
}
}
else if (SmartIndenter.isIndentationPrevented(node)) {
else if (SmartIndenter.isIndentationPrevented(node) ||
SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) {
indentation = parentDynamicIndentation.getIndentation();
}
else {
if (SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) {
indentation = parentDynamicIndentation.getIndentation();
}
else {
indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta();
}
indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta();
}
}
+1 -1
View File
@@ -482,7 +482,7 @@ namespace ts.formatting {
switch (node.kind) {
case SyntaxKind.NamedExports:
return true;
// Allow indentation only when namedBindings is NamespaceImport.
// NamedImports has its own braces as Block does
case SyntaxKind.ImportClause:
return (<ImportClause>node).namedBindings.kind === SyntaxKind.NamedImports;
}