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 5
5
6
6
import { VSBuffer } from 'vs/base/common/buffer' ;
7
7
import { CancellationToken } from 'vs/base/common/cancellation' ;
8
+ import { Iterable } from 'vs/base/common/iterator' ;
8
9
import { KeyCode , KeyMod } from 'vs/base/common/keyCodes' ;
9
10
import { Disposable , IDisposable } from 'vs/base/common/lifecycle' ;
10
11
import { parse } from 'vs/base/common/marshalling' ;
@@ -728,6 +729,21 @@ registerAction2(class extends Action2 {
728
729
if ( editorControl && editorControl . notebookEditor && editorControl . codeEditor ) {
729
730
editorService . activeEditorPane ?. focus ( ) ;
730
731
}
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
+ }
731
747
}
732
748
} ) ;
733
749
You can’t perform that action at this time.
0 commit comments