diff --git a/src/vs/workbench/browser/parts/editor/titleControl.ts b/src/vs/workbench/browser/parts/editor/titleControl.ts index 7d5ec67e02f8ba6b9a18eeac68089e290cd7f46c..88bf545413f9010e89539d1ebce6409c136921dd 100644 --- a/src/vs/workbench/browser/parts/editor/titleControl.ts +++ b/src/vs/workbench/browser/parts/editor/titleControl.ts @@ -157,7 +157,6 @@ export abstract class TitleControl { public setContext(group: IEditorGroup): void { this.context = group; - this.resourceContext.set(group && getResource(group.activeEditor)); } public update(instant?: boolean): void { @@ -277,6 +276,9 @@ export abstract class TitleControl { const {group} = identifier; const position = this.stacks.positionOfGroup(group); + // Update the resource context + this.resourceContext.set(group && getResource(group.activeEditor)); + // Editor actions require the editor control to be there, so we retrieve it via service const control = this.editorService.getVisibleEditors()[position]; if (this.stacks.isActive(group) && control instanceof BaseEditor && control.input && typeof control.position === 'number') {