Fix highlight not getting updated when switching files

This commit is contained in:
Silvano Cerza 2025-02-22 17:48:51 +01:00
parent 72a7a7ed62
commit d5eec99546

View file

@ -21,6 +21,12 @@ export function createDiffHighlightPlugin(spec: DiffHighlightPluginSpec) {
this.decorations = this.buildDecorations(view);
}
update(update: ViewUpdate) {
if (update.docChanged) {
this.decorations = this.buildDecorations(update.view);
}
}
buildDecorations(view: EditorView): DecorationSet {
const decorations = [];
const doc = view.state.doc;