From 048b8f5efa4a9d03e1f384f741cd65fd0106207e Mon Sep 17 00:00:00 2001 From: kotaindah55 Date: Thu, 6 Feb 2025 21:36:16 +0200 Subject: [PATCH] fix: no longer parse the entire text on a big file --- src/editor-mode/parser/ParserState.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor-mode/parser/ParserState.ts b/src/editor-mode/parser/ParserState.ts index e97c879..a98c8d4 100644 --- a/src/editor-mode/parser/ParserState.ts +++ b/src/editor-mode/parser/ParserState.ts @@ -96,7 +96,7 @@ export class ParserState { return null; } nextLine(skipBlankLine = true) { - if (this.linePos == this.maxLine) { + if (this.linePos >= this.maxLine) { this.queue.resolveAll(); return null; } @@ -106,7 +106,7 @@ export class ParserState { if (skipBlankLine) { if (this.isBlankLine()) { this.queue.resolveAll(this.line.to); - while (this.linePos != this.maxLine) { + while (this.linePos < this.maxLine) { this.line = this.doc.line(this.linePos + 1); if (!this.isBlankLine()) { break } }