File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/vs/workbench/contrib/interactive/browser Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 55
66import { VSBuffer } from 'vs/base/common/buffer' ;
77import { CancellationToken } from 'vs/base/common/cancellation' ;
8+ import { Iterable } from 'vs/base/common/iterator' ;
89import { KeyCode , KeyMod } from 'vs/base/common/keyCodes' ;
910import { Disposable , IDisposable } from 'vs/base/common/lifecycle' ;
1011import { parse } from 'vs/base/common/marshalling' ;
@@ -728,6 +729,21 @@ registerAction2(class extends Action2 {
728729 if ( editorControl && editorControl . notebookEditor && editorControl . codeEditor ) {
729730 editorService . activeEditorPane ?. focus ( ) ;
730731 }
732+ else {
733+ // find and open the most recent interactive window
734+ const openEditors = editorService . getEditors ( EditorsOrder . MOST_RECENTLY_ACTIVE ) ;
735+ const interactiveWindow = Iterable . find ( openEditors , identifier => { return identifier . editor . typeId === InteractiveEditorInput . ID ; } ) ;
736+ if ( interactiveWindow ) {
737+ const editorInput = interactiveWindow . editor as InteractiveEditorInput ;
738+ const currentGroup = interactiveWindow . groupId ;
739+ const editor = await editorService . openEditor ( editorInput , currentGroup ) ;
740+ const editorControl = editor ?. getControl ( ) as { notebookEditor : NotebookEditorWidget | undefined ; codeEditor : CodeEditorWidget } | undefined ;
741+
742+ if ( editorControl && editorControl . notebookEditor && editorControl . codeEditor ) {
743+ editorService . activeEditorPane ?. focus ( ) ;
744+ }
745+ }
746+ }
731747 }
732748} ) ;
733749
You can’t perform that action at this time.
0 commit comments