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