From d5eec9954636f4afc6e435d75e9e5e2f05403cbb Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Sat, 22 Feb 2025 17:48:51 +0100 Subject: [PATCH] Fix highlight not getting updated when switching files --- src/views/conflicts-resolution/diff-highlight-plugin.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/views/conflicts-resolution/diff-highlight-plugin.ts b/src/views/conflicts-resolution/diff-highlight-plugin.ts index e22fab4..9758f9e 100644 --- a/src/views/conflicts-resolution/diff-highlight-plugin.ts +++ b/src/views/conflicts-resolution/diff-highlight-plugin.ts @@ -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;