Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: show update when error decorations change (#4930)

Myles Scolnickad14e52dbd74
diff --git a/frontend/src/core/codemirror/cells/traceback-decorations.ts b/frontend/src/core/codemirror/cells/traceback-decorations.ts
index 6be6f3b64c..07429b82ea 100644
--- a/frontend/src/core/codemirror/cells/traceback-decorations.ts
+++ b/frontend/src/core/codemirror/cells/traceback-decorations.ts
@@ -56,7 +56,16 @@ class ErrorHighlighter implements PluginValue {
);
this.unsubscribe = errorsObservable.sub((errors) => {
+ // Prev length
+ const prevLength = this.decorations.size;
this.decorations = createErrorDecorations(view.state, errors);
+
+ if (prevLength !== this.decorations.size) {
+ // Force a re-render
+ view.dispatch({
+ userEvent: "marimo.error-decoration-update",
+ });
+ }
});
}