* Count the leading indentation characters of a line.
(line: string)
| 87 | * Count the leading indentation characters of a line. |
| 88 | */ |
| 89 | function getLeadingWhitespaceLength(line: string): number { |
| 90 | let count = 0; |
| 91 | for (const ch of line) { |
| 92 | if (ch === " " || ch === "\t") { |
| 93 | count++; |
| 94 | continue; |
| 95 | } |
| 96 | break; |
| 97 | } |
| 98 | return count; |
| 99 | } |
| 100 | |
| 101 | function buildGuideStyle(levels: number, guideStepPx: number): string { |
| 102 | const images = []; |