diff --git a/dist/index.cjs b/dist/index.cjs index db9d5491d5d5ffba46c85d822f0bc75d15ecebc4..8d3637e4dd4d12053e08e6b27ee70b52f6d48093 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -422,12 +422,15 @@ class ParseContext { treeLen = 0; viewport = { from: changes.mapPos(viewport.from, -1), to: changes.mapPos(viewport.to, 1) }; + skipped = []; if (this.skipped.length) { - skipped = []; for (let r of this.skipped) { let from = changes.mapPos(r.from, 1), to = changes.mapPos(r.to, -1); if (from < to) skipped.push({ from, to }); } } + } + else { + skipped = skipped.slice(); } return new ParseContext(this.parser, newState, fragments, tree, treeLen, viewport, skipped, this.scheduleOn); @@ -1891,7 +1894,7 @@ const bracketMatcher = view.ViewPlugin.fromClass(class { this.decorations = bracketDeco(view.state); } update(update) { - if (update.docChanged || update.selectionSet || this.paused) { + if (update.docChanged || update.selectionSet || this.paused || syntaxTree(update.state) != syntaxTree(update.startState)) { if (update.view.composing) { this.decorations = this.decorations.map(update.changes); this.paused = true; diff --git a/dist/index.js b/dist/index.js index 32c1054f848d845ab8b9a71ff406bb59cca2ceb3..8cf64f5cd7298ba67fe01d9c19d262651d73cd0a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -421,12 +421,15 @@ class ParseContext { treeLen = 0; viewport = { from: changes.mapPos(viewport.from, -1), to: changes.mapPos(viewport.to, 1) }; + skipped = []; if (this.skipped.length) { - skipped = []; for (let r of this.skipped) { let from = changes.mapPos(r.from, 1), to = changes.mapPos(r.to, -1); if (from < to) skipped.push({ from, to }); } } + } + else { + skipped = skipped.slice(); } return new ParseContext(this.parser, newState, fragments, tree, treeLen, viewport, skipped, this.scheduleOn); @@ -1890,7 +1893,7 @@ const bracketMatcher = /*@__PURE__*/ViewPlugin.fromClass(class { this.decorations = bracketDeco(view.state); } update(update) { - if (update.docChanged || update.selectionSet || this.paused) { + if (update.docChanged || update.selectionSet || this.paused || syntaxTree(update.state) != syntaxTree(update.startState)) { if (update.view.composing) { this.decorations = this.decorations.map(update.changes); this.paused = true;