feat: assign blkStart at the initialization

This commit is contained in:
kotaindah55 2025-02-08 22:45:02 +02:00
parent 212e4d5789
commit a9c836cd35

View file

@ -31,6 +31,15 @@ export class ParserState {
this.cursor = this.tree.cursor();
this.settings = config.settings;
this.nextCursor();
// if previous line is a blank line or the
// current line is the first line, then the current one
// should be a block start
let prevLine = this.prevLine;
if (prevLine) {
this.blkStart = isBlankLine(prevLine);
} else {
this.blkStart = true;
}
if (
(!this.lastToken || this.lastToken.to < this.line.from) &&
this.lineStr[0] == "!" && this.offset < 11