@@ -642,8 +642,10 @@ export class EditorService extends Disposable implements EditorServiceImpl {
642642 return [ group , activation ] ;
643643 }
644644
645- private doFindTargetGroup ( editor : IEditorInputWithOptions | IUntypedEditorInput , preferredGroup : OpenInEditorGroup | undefined ) : IEditorGroup {
645+ private doFindTargetGroup ( input : IEditorInputWithOptions | IUntypedEditorInput , preferredGroup : OpenInEditorGroup | undefined ) : IEditorGroup {
646646 let group : IEditorGroup | undefined ;
647+ let editor = isEditorInputWithOptions ( input ) ? input . editor : input ;
648+ let options = input . options ;
647649
648650 // Group: Instance of Group
649651 if ( preferredGroup && typeof preferredGroup !== 'number' ) {
@@ -661,11 +663,11 @@ export class EditorService extends Disposable implements EditorServiceImpl {
661663 }
662664
663665 // Group: Unspecified without a specific index to open
664- else if ( ! editor . options || typeof editor . options . index !== 'number' ) {
666+ else if ( ! options || typeof options . index !== 'number' ) {
665667 const groupsByLastActive = this . editorGroupService . getGroups ( GroupsOrder . MOST_RECENTLY_ACTIVE ) ;
666668
667669 // Respect option to reveal an editor if it is already visible in any group
668- if ( editor . options ?. revealIfVisible ) {
670+ if ( options ?. revealIfVisible ) {
669671 for ( const lastActiveGroup of groupsByLastActive ) {
670672 if ( lastActiveGroup . isActive ( editor ) ) {
671673 group = lastActiveGroup ;
@@ -677,7 +679,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
677679 // Respect option to reveal an editor if it is open (not necessarily visible)
678680 // Still prefer to reveal an editor in a group where the editor is active though.
679681 if ( ! group ) {
680- if ( editor . options ?. revealIfOpened || this . configurationService . getValue < boolean > ( 'workbench.editor.revealIfOpen' ) ) {
682+ if ( options ?. revealIfOpened || this . configurationService . getValue < boolean > ( 'workbench.editor.revealIfOpen' ) ) {
681683 let groupWithInputActive : IEditorGroup | undefined = undefined ;
682684 let groupWithInputOpened : IEditorGroup | undefined = undefined ;
683685
0 commit comments