530
let wrappedTextIndentLength = 0;
531
if (wrappingIndent !== WrappingIndent.None) {
533
>
if (firstNonWhitespaceIndex !== -1) {
534
>
// Track existing indent
535
>
536
>
for (let i = 0; i < firstNonWhitespaceIndex; i++) {
537
const charWidth = (lineText.charCodeAt(i) === CharCode.Tab ? tabCharacterWidth(wrappedTextIndentLength, tabSize) : 1);
538
wrappedTextIndentLength += charWidth;
539
}
541
>
// Increase indent of continuation lines, if desired
542
>
const numberOfAdditionalTabs = (wrappingIndent === WrappingIndent.DeepIndent ? 2 : wrappingIndent === WrappingIndent.Indent ? 1 : 0);
543
>
for (let i = 0; i < numberOfAdditionalTabs; i++) {
544
const charWidth = tabCharacterWidth(wrappedTextIndentLength, tabSize);
545
wrappedTextIndentLength += charWidth;
546
}
548
>
// Force sticking to beginning of line if no character would fit except for the indentation
549
>
if (wrappedTextIndentLength + columnsForFullWidthChar > firstLineBreakColumn) {
550
wrappedTextIndentLength = 0;
551
}
553
>
}
554
return wrappedTextIndentLength;
555
}