Skip to content

Commit

Permalink
Allow reopening of native REPL after closing (#23478)
Browse files Browse the repository at this point in the history
Resolves: #23477
  • Loading branch information
anthonykim1 committed May 24, 2024
1 parent 75cc52b commit 55fd22c
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/client/repl/replCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,18 @@ 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;
}
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);
Expand Down

0 comments on commit 55fd22c

Please sign in to comment.