Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/parsers/ParsingError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ export class ParsingValidationError extends MetaBindError {
return '';
}

const spacing = ' '.repeat(this.position.from.index + offset);
const spacing = ' '.repeat(this.position.from.column + offset);
// highlight to the end if the end is on the same line. If the end is on a different line, highlight to the end of the line.
const toIndex = this.position.to.line === this.position.from.line ? this.position.to.index : lineLength;
const underline = '^'.repeat(toIndex - this.position.from.index);
const toIndex = this.position.to.line === this.position.from.line ? this.position.to.column : lineLength;
const underline = '^'.repeat(toIndex - this.position.from.column);

return spacing + underline;
}
Expand Down