|
|
@ -18,9 +18,7 @@ export default function get_code_frame(
|
|
|
|
.slice(frame_start, frame_end)
|
|
|
|
.slice(frame_start, frame_end)
|
|
|
|
.map((str, i) => {
|
|
|
|
.map((str, i) => {
|
|
|
|
const isErrorLine = frame_start + i === line;
|
|
|
|
const isErrorLine = frame_start + i === line;
|
|
|
|
|
|
|
|
const line_num = String(i + frame_start + 1).padStart(digits, ' ');
|
|
|
|
let line_num = String(i + frame_start + 1);
|
|
|
|
|
|
|
|
while (line_num.length < digits) line_num = ` ${line_num}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isErrorLine) {
|
|
|
|
if (isErrorLine) {
|
|
|
|
const indicator = ' '.repeat(digits + 2 + tabs_to_spaces(str.slice(0, column)).length) + '^';
|
|
|
|
const indicator = ' '.repeat(digits + 2 + tabs_to_spaces(str.slice(0, column)).length) + '^';
|
|
|
|