From 6c8ce72bafcdf7aa944d1dc4816effbfa293ca3a Mon Sep 17 00:00:00 2001 From: kotaindah55 Date: Mon, 3 Feb 2025 23:17:48 +0200 Subject: [PATCH] fix: reassign offset to 0 before resolveContext resolveContext should be executed once at streamParse before iterating parseLine, or at each nextLine after reassigning this.line to its next and this.offset to 0. --- src/editor-mode/parser/ParserState.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor-mode/parser/ParserState.ts b/src/editor-mode/parser/ParserState.ts index 449770a..d35df00 100644 --- a/src/editor-mode/parser/ParserState.ts +++ b/src/editor-mode/parser/ParserState.ts @@ -99,6 +99,7 @@ export class ParserState { return null; } this.line = this.doc.line(this.linePos + 1); + this.offset = 0; this.resolveContext(); if (skipBlankLine) { if (this.isBlankLine()) { @@ -110,7 +111,6 @@ export class ParserState { } } } - this.offset = 0; return this.line; } isLastLine() {