From 87e723649ead1a899842c30af71d58dd356c30a5 Mon Sep 17 00:00:00 2001 From: Dsm0 Date: Sun, 18 Jan 2026 23:43:11 -0800 Subject: [PATCH] fixed highlighting issue --- packages/codemirror/highlight.mjs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/codemirror/highlight.mjs b/packages/codemirror/highlight.mjs index 5cc6d3a11..b37390ef7 100644 --- a/packages/codemirror/highlight.mjs +++ b/packages/codemirror/highlight.mjs @@ -25,7 +25,6 @@ const miniLocations = StateField.define({ //block-based eval case if (e.value.range) { const stateMiniLocations = getMiniLocationsFromDecorations(locations); - const existingById = new Map(stateMiniLocations.map(({ id, from, to }) => [id, [from, to]])); const normalized = e.value.locations .filter(([from]) => from < tr.newDoc.length) @@ -35,13 +34,12 @@ const miniLocations = StateField.define({ const marks = normalized.map((range) => { const id = range.join(':'); - const useRange = existingById.get(id) || range; return Decoration.mark({ id, // this green is only to verify that the decoration moves when the document is edited // it will be removed later, so the mark is not visible by default attributes: { style: `background-color: #00CA2880` }, - }).range(...useRange); // -> Decoration + }).range(...range); // -> Decoration }); const previousMarks = stateMiniLocations