diff --git a/services/web/frontend/js/features/source-editor/hooks/use-codemirror-scope.ts b/services/web/frontend/js/features/source-editor/hooks/use-codemirror-scope.ts index c17493a237..2ab87219b4 100644 --- a/services/web/frontend/js/features/source-editor/hooks/use-codemirror-scope.ts +++ b/services/web/frontend/js/features/source-editor/hooks/use-codemirror-scope.ts @@ -436,7 +436,9 @@ function useCodeMirrorScope(view: EditorView) { if (cursorHighlights && currentDoc) { const items = cursorHighlights[currentDoc.doc_id] highlightsRef.current.cursorHighlights = items - view.dispatch(setCursorHighlights(items)) + window.setTimeout(() => { + view.dispatch(setCursorHighlights(items)) + }) } }, [view, cursorHighlights, currentDoc])