Skip to content

Commit 572ab76

Browse files
committed
Fix an update bug in MatchDecorator
FIX: Fix a crash in MatchDecorator when updating matches at the end of the document. See https://discuss.codemirror.net/t/the-problem-of-multiple-extension-implementations/8917
1 parent 08b3af0 commit 572ab76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/matchdecorator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class MatchDecorator {
103103
updateDeco(update: ViewUpdate, deco: DecorationSet) {
104104
let changeFrom = 1e9, changeTo = -1
105105
if (update.docChanged) update.changes.iterChanges((_f, _t, from, to) => {
106-
if (to > update.view.viewport.from && from < update.view.viewport.to) {
106+
if (to >= update.view.viewport.from && from <= update.view.viewport.to) {
107107
changeFrom = Math.min(from, changeFrom)
108108
changeTo = Math.max(to, changeTo)
109109
}

0 commit comments

Comments
 (0)