Wrap setCursorHighlights in setTimeout (#12951)

GitOrigin-RevId: 204bf073bc2f4a014d9498c6a802fe38e52b22c5
This commit is contained in:
Alf Eaton 2023-05-05 09:35:15 +01:00 committed by Copybot
parent 0fba9dc374
commit 009a108c71

View file

@ -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])