Replace _all_ tabs in pretty output, not just the first on each line (#42649)

This commit is contained in:
Wesley Wigham
2021-02-04 13:25:53 -08:00
committed by GitHub
parent be18057792
commit 62bc8bec4e
6 changed files with 87 additions and 1 deletions

View File

@@ -407,7 +407,7 @@ namespace ts {
const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
let lineContent = file.text.slice(lineStart, lineEnd);
lineContent = lineContent.replace(/\s+$/g, ""); // trim from end
lineContent = lineContent.replace("\t", " "); // convert tabs to single spaces
lineContent = lineContent.replace(/\t/g, " "); // convert tabs to single spaces
// Output the gutter and the actual contents of the line.
context += indent + formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;