Wrap setCursorHighlights in setTimeout (#12951)

GitOrigin-RevId: 204bf073bc2f4a014d9498c6a802fe38e52b22c5
This commit is contained in:
Alf Eaton
2023-05-08 08:04:00 +00:00
committed by Copybot
parent f1d07437cb
commit a7518c1bb4
@@ -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])