76
continue;
77
}
79
>
const oldIndentation = strings.getLeadingWhitespace(text);
80
>
const currentIdealIndent = idealIndentForNextLine;
81
>
82
>
if (processedIndentRulesSupport.shouldDecrease(lineNumber, currentIdealIndent)) {
83
idealIndentForNextLine = unshiftIndent(idealIndentForNextLine);
84
globalIndent = unshiftIndent(globalIndent);
85
}
87
>
if (oldIndentation !== idealIndentForNextLine) {
88
indentEdits.push(EditOperation.replaceMove(new Selection(lineNumber, 1, lineNumber, oldIndentation.length + 1), normalizeIndentation(idealIndentForNextLine, indentSize, insertSpaces)));
89
}
91
>
// calculate idealIndentForNextLine
92
>
if (processedIndentRulesSupport.shouldIgnore(lineNumber)) {
93
// In reindent phase, if the line matches `unIndentedLinePattern` we inherit indentation from above lines
94
// but don't change globalIndent and idealIndentForNextLine.
95
continue;
96
>
} else if (processedIndentRulesSupport.shouldIncrease(lineNumber, currentIdealIndent)) {
indentation.ts
97
globalIndent = shiftIndent(globalIndent);
98
idealIndentForNextLine = globalIndent;
99
>
} else if (processedIndentRulesSupport.shouldIndentNextLine(lineNumber, currentIdealIndent)) {
indentation.ts
100
idealIndentForNextLine = shiftIndent(idealIndentForNextLine);
102
>
idealIndentForNextLine = globalIndent;
103
>
}
104
}
105