Skip to content

Commit 5ff5384

Browse files
Simplify adding indentation
1 parent 72c646c commit 5ff5384

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

extensions/ql-vscode/src/variant-analysis/markdown-generation.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,9 @@ function generateMarkdownForPathResults(
283283
language,
284284
threadFlow.highlightedRegion,
285285
);
286-
// Indent the snippet to fit with the numbered list.
287-
// The indentation is "n + 2" where the list number is an n-digit number.
286+
const indentation = " ".repeat(listNumber.toString().length + 2);
288287
pathLines.push(
289-
...codeSnippet.map((line) =>
290-
(" ".repeat(listNumber.toString().length + 2) + line).trimEnd(),
291-
),
288+
...codeSnippet.map((line) => indentation + line.trimEnd()),
292289
);
293290
}
294291
}

0 commit comments

Comments
 (0)