Skip to content

Commit 4cf27bd

Browse files
author
Benjamin Pasero
committed
💄 CloseLeftEditorsInGroupAction
1 parent 531c0a1 commit 4cf27bd

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

src/vs/workbench/browser/parts/editor/editorActions.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -491,27 +491,26 @@ export class CloseLeftEditorsInGroupAction extends Action {
491491
constructor(
492492
id: string,
493493
label: string,
494-
@IEditorService private readonly editorService: IEditorService,
495494
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService
496495
) {
497496
super(id, label);
498497
}
499498

500499
async run(context?: IEditorIdentifier): Promise<void> {
501-
const { group, editor } = getTarget(this.editorService, this.editorGroupService, context);
500+
const { group, editor } = this.getTarget(context);
502501
if (group && editor) {
503502
return group.closeEditors({ direction: CloseDirection.LEFT, except: editor, excludeSticky: true });
504503
}
505504
}
506-
}
507505

508-
function getTarget(editorService: IEditorService, editorGroupService: IEditorGroupsService, context?: IEditorIdentifier): { editor: IEditorInput | null, group: IEditorGroup | undefined } {
509-
if (context) {
510-
return { editor: context.editor, group: editorGroupService.getGroup(context.groupId) };
511-
}
506+
private getTarget(context?: IEditorIdentifier): { editor: IEditorInput | null, group: IEditorGroup | undefined } {
507+
if (context) {
508+
return { editor: context.editor, group: this.editorGroupService.getGroup(context.groupId) };
509+
}
512510

513-
// Fallback to active group
514-
return { group: editorGroupService.activeGroup, editor: editorGroupService.activeGroup.activeEditor };
511+
// Fallback to active group
512+
return { group: this.editorGroupService.activeGroup, editor: this.editorGroupService.activeGroup.activeEditor };
513+
}
515514
}
516515

517516
abstract class BaseCloseAllAction extends Action {

0 commit comments

Comments
 (0)