parent
b984d47ac4
commit
b14f4a505b
@ -14,7 +14,11 @@ export function generateCodeFrame(
|
||||
for (let j = i - range; j <= i + range || end > count; j++) {
|
||||
if (j < 0 || j >= lines.length) continue
|
||||
const line = j + 1
|
||||
res.push(`${line}${' '.repeat(3 - String(line).length)}| ${lines[j]}`)
|
||||
res.push(
|
||||
`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${
|
||||
lines[j]
|
||||
}`
|
||||
)
|
||||
const lineLength = lines[j].length
|
||||
if (j === i) {
|
||||
// push underline
|
||||
|
Loading…
Reference in New Issue
Block a user