Skip to content

Commit 92db21f

Browse files
authored
1 parent 4e2aa98 commit 92db21f

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,6 @@ export class PaneCompositeBar extends Disposable {
207207

208208
if (to === this.location) {
209209
this.onDidRegisterViewContainers([container]);
210-
211-
// Open view container if part is visible and there is no other view container opened
212-
const visibleComposites = this.compositeBar.getVisibleComposites();
213-
if (!this.paneCompositePart.getActivePaneComposite() && this.layoutService.isVisible(this.paneCompositePart.partId) && visibleComposites.length) {
214-
this.paneCompositePart.openPaneComposite(visibleComposites[0].id);
215-
}
216210
}
217211
}
218212

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export abstract class AbstractPaneCompositePart extends CompositePart<PaneCompos
180180
this._register(this.onDidPaneCompositeClose(this.onDidClose, this));
181181
this._register(this.globalActions.onDidChange(() => this.updateGlobalToolbarActions()));
182182

183-
this._register(this.registry.onDidDeregister(async (viewletDescriptor: PaneCompositeDescriptor) => {
183+
this._register(this.registry.onDidDeregister((viewletDescriptor: PaneCompositeDescriptor) => {
184184

185185
const activeContainers = this.viewDescriptorService.getViewContainersByLocation(this.location)
186186
.filter(container => this.viewDescriptorService.getViewContainerModel(container).activeViewDescriptors.length > 0);
@@ -189,7 +189,7 @@ export abstract class AbstractPaneCompositePart extends CompositePart<PaneCompos
189189
if (this.getActiveComposite()?.getId() === viewletDescriptor.id) {
190190
const defaultViewletId = this.viewDescriptorService.getDefaultViewContainer(this.location)?.id;
191191
const containerToOpen = activeContainers.filter(c => c.id === defaultViewletId)[0] || activeContainers[0];
192-
await this.openPaneComposite(containerToOpen.id);
192+
this.doOpenPaneComposite(containerToOpen.id);
193193
}
194194
} else {
195195
this.layoutService.setPartHidden(true, this.partId);

src/vs/workbench/services/views/browser/viewsService.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ export class ViewsService extends Disposable implements IViewsService {
137137
private onDidChangeContainerLocation(viewContainer: ViewContainer, from: ViewContainerLocation, to: ViewContainerLocation): void {
138138
this.deregisterPaneComposite(viewContainer, from);
139139
this.registerPaneComposite(viewContainer, to);
140+
141+
// Open view container if part is visible and there is only one view container in location
142+
if (this.layoutService.isVisible(getPartByLocation(to)) && this.viewDescriptorService.getViewContainersByLocation(to).length === 1) {
143+
this.openViewContainer(viewContainer.id);
144+
}
140145
}
141146

142147
private onViewDescriptorsAdded(views: ReadonlyArray<IViewDescriptor>, container: ViewContainer): void {

0 commit comments

Comments
 (0)