Skip to content

Commit 9755096

Browse files
authored
Merge pull request #915 from remap-keys/fix/reset-editor-tab-on-file-switch
fix: Reset editor tab to Code Editor when switching files
2 parents 20ea9a4 + 3abebb4 commit 9755096

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/components/workbench/breadboard/Breadboard.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,12 +551,10 @@ function EditorWithVisualTab(props: EditorWithVisualTabProps) {
551551

552552
// Reset to Code Editor tab when file changes or is not a tabbed file
553553
useEffect(() => {
554-
if (!hasTabs) {
555-
setEditorTab(0);
556-
}
554+
setEditorTab(0);
557555
pendingCodeRef.current = undefined;
558556
setCodeSnapshot(null);
559-
}, [hasTabs, file?.id]);
557+
}, [file?.id]);
560558

561559
// Called by WorkbenchSourceCodeEditor on every keystroke (not debounced)
562560
const handleImmediateCodeChange = useCallback((code: string) => {

0 commit comments

Comments
 (0)