Skip to content

Commit f74fa77

Browse files
committed
Fix stale editor flash when opening files
1 parent f37d081 commit f74fa77

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎anycode/features/editor/EditorPanel.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ export const EditorPanel = ({ panelKey, editors }: EditorPanelProps) => {
4141
}
4242
}, [paneFileId, paneFile, editorState]);
4343

44+
const editorForCurrentFile = lastReadyEditor?.id === paneFileId
45+
? lastReadyEditor
46+
: null;
4447
const displayedEditor = paneFile && editorState
4548
? { id: paneFile.id, state: editorState }
46-
: lastReadyEditor;
49+
: editorForCurrentFile;
4750

4851
return (
4952
<div

0 commit comments

Comments
 (0)