diff --git a/src/editorview.ts b/src/editorview.ts index eee1109..3a99e31 100644 --- a/src/editorview.ts +++ b/src/editorview.ts @@ -315,7 +315,10 @@ export class EditorView { this.viewState.mustMeasureContent = true if (redrawn || attrsChanged || scrollTarget || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) this.requestMeasure() - if (!update.empty) for (let listener of this.state.facet(updateListener)) listener(update) + if (!update.empty) for (let listener of this.state.facet(updateListener)) { + try { listener(update) } + catch (e) { logException(this.state, e, "update listener") } + } if (dispatchFocus || domChange) Promise.resolve().then(() => { if (dispatchFocus && this.state == dispatchFocus.startState) this.dispatch(dispatchFocus)