@@ -642,8 +642,10 @@ export class EditorService extends Disposable implements EditorServiceImpl {
642
642
return [ group , activation ] ;
643
643
}
644
644
645
- private doFindTargetGroup ( editor : IEditorInputWithOptions | IUntypedEditorInput , preferredGroup : OpenInEditorGroup | undefined ) : IEditorGroup {
645
+ private doFindTargetGroup ( input : IEditorInputWithOptions | IUntypedEditorInput , preferredGroup : OpenInEditorGroup | undefined ) : IEditorGroup {
646
646
let group : IEditorGroup | undefined ;
647
+ let editor = isEditorInputWithOptions ( input ) ? input . editor : input ;
648
+ let options = input . options ;
647
649
648
650
// Group: Instance of Group
649
651
if ( preferredGroup && typeof preferredGroup !== 'number' ) {
@@ -661,11 +663,11 @@ export class EditorService extends Disposable implements EditorServiceImpl {
661
663
}
662
664
663
665
// 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' ) {
665
667
const groupsByLastActive = this . editorGroupService . getGroups ( GroupsOrder . MOST_RECENTLY_ACTIVE ) ;
666
668
667
669
// Respect option to reveal an editor if it is already visible in any group
668
- if ( editor . options ?. revealIfVisible ) {
670
+ if ( options ?. revealIfVisible ) {
669
671
for ( const lastActiveGroup of groupsByLastActive ) {
670
672
if ( lastActiveGroup . isActive ( editor ) ) {
671
673
group = lastActiveGroup ;
@@ -677,7 +679,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
677
679
// Respect option to reveal an editor if it is open (not necessarily visible)
678
680
// Still prefer to reveal an editor in a group where the editor is active though.
679
681
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' ) ) {
681
683
let groupWithInputActive : IEditorGroup | undefined = undefined ;
682
684
let groupWithInputOpened : IEditorGroup | undefined = undefined ;
683
685
0 commit comments