Skip to content

Commit

Permalink
Avoid match decorators doing a full rebuild on normal edits
Browse files Browse the repository at this point in the history
FIX: Fix an issue in `MatchDecorator` that caused it to fully rebuild its
decorations on normal edits.

See https://discuss.codemirror.net/t/performance-issues-with-extension/8896
  • Loading branch information
marijnh committed Dec 12, 2024
1 parent 3a12a84 commit 32aa0e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/matchdecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class MatchDecorator {
changeTo = Math.max(to, changeTo)
}
})
if (update.viewportChanged || changeTo - changeFrom > 1000)
if (update.viewportMoved || changeTo - changeFrom > 1000)
return this.createDeco(update.view)
if (changeTo > -1)
return this.updateRange(update.view, deco.map(update.changes), changeFrom, changeTo)
Expand Down

0 comments on commit 32aa0e8

Please sign in to comment.