Repository navigation
Stop creating duplicate REPL and allow new REPL instance - #23496
Conversation
| notebookDocument = interactiveWindowObject.notebookEditor.notebook; | ||
| } | ||
| // Handle case where user has closed REPL window, and re-opens. | ||
| if (notebookEditor && notebookDocument) { |
There was a problem hiding this comment.
shouldn't these be set to undefined if the REPL window closes?
There was a problem hiding this comment.
Exactly, that is the intended behavior and not properly handling that was the root cause of the problems. Hence why we would want to watch for user when they close the REPL window and explicitly set them to undefined:
if (!interactiveWindowIsOpen) {
notebookEditor = undefined;
notebookDocument = undefined;
}
so then we can create a valid and fresh REPL instance again when user shift+enter.
With the code block that starts at line 109 (if statement block), we need in order to show the "new" instance of REPL after user has exited out of previous REPL instance and want to trigger REPL again. Excluding the showNotebook call stopped REPL from being shown if user has exited out of one REPL instance.
There was a problem hiding this comment.
This also runs every time the command is run, right? It's probably fine to show bring the editor up front every time for that command, but selecting the kernel every time is a bit strange - maybe that should go into the conditional above where the editor is being created.
There was a problem hiding this comment.
I believe so, I think we should be fine but just wanted to be safe..
I removed it in the latest commit
Resolves: #23495
Resolves: #23500