Fix case when a document contains multiple script blocks with different base indentations.
Use the base indent size if it is greater that the indentation of the inherited predecessor
This commit is contained in:
parent
218a5ba0bb
commit
369253bbc4
1 changed files with 5 additions and 0 deletions
|
@ -394,6 +394,11 @@ namespace ts.formatting {
|
|||
const startLinePosition = getLineStartPositionForPosition(startPos, sourceFile);
|
||||
const column = SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options);
|
||||
if (startLine !== parentStartLine || startPos === column) {
|
||||
// Use the base indent size if it is greater than
|
||||
// the indentation of the inherited predecessor.
|
||||
if (options.BaseIndentSize > column) {
|
||||
return options.BaseIndentSize;
|
||||
}
|
||||
return column;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue