Skip to content

Commit 55fd22c

Browse files
authored
Allow reopening of native REPL after closing (#23478)
Resolves: #23477
1 parent 75cc52b commit 55fd22c

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/client/repl/replCommands.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,18 @@ export async function registerReplCommands(
8282
const activeEditor = window.activeTextEditor as TextEditor;
8383
const code = await getSelectedTextToExecute(activeEditor);
8484

85-
if (!notebookEditor) {
86-
const interactiveWindowObject = (await commands.executeCommand(
87-
'interactive.open',
88-
{
89-
preserveFocus: true,
90-
viewColumn: ViewColumn.Beside,
91-
},
92-
undefined,
93-
notebookController.id,
94-
'Python REPL',
95-
)) as { notebookEditor: NotebookEditor };
96-
notebookEditor = interactiveWindowObject.notebookEditor;
97-
notebookDocument = interactiveWindowObject.notebookEditor.notebook;
98-
}
85+
const interactiveWindowObject = (await commands.executeCommand(
86+
'interactive.open',
87+
{
88+
preserveFocus: true,
89+
viewColumn: ViewColumn.Beside,
90+
},
91+
undefined,
92+
notebookController.id,
93+
'Python REPL',
94+
)) as { notebookEditor: NotebookEditor };
95+
notebookEditor = interactiveWindowObject.notebookEditor;
96+
notebookDocument = interactiveWindowObject.notebookEditor.notebook;
9997

10098
if (notebookDocument) {
10199
notebookController.updateNotebookAffinity(notebookDocument, NotebookControllerAffinity.Default);

0 commit comments

Comments
 (0)