Skip to content

Commit d3066ce

Browse files
author
Benjamin Pasero
committed
propagate editor part visibility (fix microsoft#68320)
1 parent fe5a70e commit d3066ce

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,15 @@ export interface IEditorOpeningEvent extends IEditorIdentifier {
8181
}
8282

8383
export interface IEditorGroupsAccessor {
84+
8485
readonly groups: IEditorGroupView[];
8586
readonly activeGroup: IEditorGroupView;
8687

8788
readonly partOptions: IEditorPartOptions;
8889
readonly onDidEditorPartOptionsChange: Event<IEditorPartOptionsChangeEvent>;
8990

91+
readonly onDidVisibilityChange: Event<boolean>;
92+
9093
getGroup(identifier: GroupIdentifier): IEditorGroupView | undefined;
9194
getGroups(order: GroupsOrder): IEditorGroupView[];
9295

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ export class EditorControl extends Disposable {
221221
}
222222
}
223223

224+
setVisible(visible: boolean): void {
225+
if (this._activeControl) {
226+
this._activeControl.setVisible(visible, this.groupView);
227+
}
228+
}
229+
224230
layout(dimension: Dimension): void {
225231
this.dimension = dimension;
226232

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,9 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
468468

469469
// Option Changes
470470
this._register(this.accessor.onDidEditorPartOptionsChange(e => this.onDidEditorPartOptionsChange(e)));
471+
472+
// Visibility
473+
this._register(this.accessor.onDidVisibilityChange(e => this.onDidVisibilityChange(e)));
471474
}
472475

473476
private onDidEditorPin(editor: EditorInput): void {
@@ -635,6 +638,12 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
635638
this._onDidGroupChange.fire({ kind: GroupChangeKind.EDITOR_LABEL, editor });
636639
}
637640

641+
private onDidVisibilityChange(visible: boolean): void {
642+
643+
// Forward to editor control
644+
this.editorControl.setVisible(visible);
645+
}
646+
638647
//#endregion
639648

640649
//region IEditorGroupView

0 commit comments

Comments
 (0)