From 83c8e26e91e3f1fa465b3f4b820e87fec781acbe Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Fri, 24 May 2024 10:36:58 -0700 Subject: [PATCH 1/2] allow reopen notebook REPL --- src/client/repl/replCommands.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/client/repl/replCommands.ts b/src/client/repl/replCommands.ts index d9d0858a6637..1c9d5585ccd1 100644 --- a/src/client/repl/replCommands.ts +++ b/src/client/repl/replCommands.ts @@ -82,20 +82,20 @@ export async function registerReplCommands( const activeEditor = window.activeTextEditor as TextEditor; const code = await getSelectedTextToExecute(activeEditor); - if (!notebookEditor) { - const interactiveWindowObject = (await commands.executeCommand( - 'interactive.open', - { - preserveFocus: true, - viewColumn: ViewColumn.Beside, - }, - undefined, - notebookController.id, - 'Python REPL', - )) as { notebookEditor: NotebookEditor }; - notebookEditor = interactiveWindowObject.notebookEditor; - notebookDocument = interactiveWindowObject.notebookEditor.notebook; - } + // if (!notebookEditor) { + const interactiveWindowObject = (await commands.executeCommand( + 'interactive.open', + { + preserveFocus: true, + viewColumn: ViewColumn.Beside, + }, + undefined, + notebookController.id, + 'Python REPL', + )) as { notebookEditor: NotebookEditor }; + notebookEditor = interactiveWindowObject.notebookEditor; + notebookDocument = interactiveWindowObject.notebookEditor.notebook; + // } if (notebookDocument) { notebookController.updateNotebookAffinity(notebookDocument, NotebookControllerAffinity.Default); From fe6cadcfea6bf326826be3a0a4fe9ee9f37fbf78 Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Fri, 24 May 2024 10:39:05 -0700 Subject: [PATCH 2/2] clean up --- src/client/repl/replCommands.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/client/repl/replCommands.ts b/src/client/repl/replCommands.ts index 1c9d5585ccd1..fd9b74f6602e 100644 --- a/src/client/repl/replCommands.ts +++ b/src/client/repl/replCommands.ts @@ -82,7 +82,6 @@ export async function registerReplCommands( const activeEditor = window.activeTextEditor as TextEditor; const code = await getSelectedTextToExecute(activeEditor); - // if (!notebookEditor) { const interactiveWindowObject = (await commands.executeCommand( 'interactive.open', { @@ -95,7 +94,6 @@ export async function registerReplCommands( )) as { notebookEditor: NotebookEditor }; notebookEditor = interactiveWindowObject.notebookEditor; notebookDocument = interactiveWindowObject.notebookEditor.notebook; - // } if (notebookDocument) { notebookController.updateNotebookAffinity(notebookDocument, NotebookControllerAffinity.Default);