From eea9b84041054ba4479da0e3bc7464e055fcdf8a Mon Sep 17 00:00:00 2001 From: Thiago Alves Date: Wed, 11 Mar 2026 22:47:19 -0400 Subject: [PATCH] fix: recompute debug inline positions when editor mounts during active debug When an ST tab is opened after the debugger is already running, editorRef is null during the initial debugVarPositions memo computation. Since ref changes don't trigger re-renders, the memo never recomputes and no badges appear. Add an editorMounted state flag set in handleEditorDidMount so the position-scanning memo re-runs when the editor becomes available. Co-Authored-By: Claude Opus 4.6 --- .../components/_features/[workspace]/editor/monaco/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/_features/[workspace]/editor/monaco/index.tsx b/src/renderer/components/_features/[workspace]/editor/monaco/index.tsx index 31226bac3..a0c678c1d 100644 --- a/src/renderer/components/_features/[workspace]/editor/monaco/index.tsx +++ b/src/renderer/components/_features/[workspace]/editor/monaco/index.tsx @@ -114,6 +114,7 @@ const MonacoEditor = (props: monacoEditorProps): ReturnType(null) const monacoRef = useRef(null) const focusDisposables = useRef<{ onFocus?: monaco.IDisposable; onBlur?: monaco.IDisposable }>({}) + const [editorMounted, setEditorMounted] = useState(false) const { editor, @@ -356,7 +357,7 @@ const MonacoEditor = (props: monacoEditorProps): ReturnType { @@ -724,6 +725,7 @@ const MonacoEditor = (props: monacoEditorProps): ReturnType