File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -207,12 +207,6 @@ export class PaneCompositeBar extends Disposable {
207
207
208
208
if ( to === this . location ) {
209
209
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
- }
216
210
}
217
211
}
218
212
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ export abstract class AbstractPaneCompositePart extends CompositePart<PaneCompos
180
180
this . _register ( this . onDidPaneCompositeClose ( this . onDidClose , this ) ) ;
181
181
this . _register ( this . globalActions . onDidChange ( ( ) => this . updateGlobalToolbarActions ( ) ) ) ;
182
182
183
- this . _register ( this . registry . onDidDeregister ( async ( viewletDescriptor : PaneCompositeDescriptor ) => {
183
+ this . _register ( this . registry . onDidDeregister ( ( viewletDescriptor : PaneCompositeDescriptor ) => {
184
184
185
185
const activeContainers = this . viewDescriptorService . getViewContainersByLocation ( this . location )
186
186
. filter ( container => this . viewDescriptorService . getViewContainerModel ( container ) . activeViewDescriptors . length > 0 ) ;
@@ -189,7 +189,7 @@ export abstract class AbstractPaneCompositePart extends CompositePart<PaneCompos
189
189
if ( this . getActiveComposite ( ) ?. getId ( ) === viewletDescriptor . id ) {
190
190
const defaultViewletId = this . viewDescriptorService . getDefaultViewContainer ( this . location ) ?. id ;
191
191
const containerToOpen = activeContainers . filter ( c => c . id === defaultViewletId ) [ 0 ] || activeContainers [ 0 ] ;
192
- await this . openPaneComposite ( containerToOpen . id ) ;
192
+ this . doOpenPaneComposite ( containerToOpen . id ) ;
193
193
}
194
194
} else {
195
195
this . layoutService . setPartHidden ( true , this . partId ) ;
Original file line number Diff line number Diff line change @@ -137,6 +137,11 @@ export class ViewsService extends Disposable implements IViewsService {
137
137
private onDidChangeContainerLocation ( viewContainer : ViewContainer , from : ViewContainerLocation , to : ViewContainerLocation ) : void {
138
138
this . deregisterPaneComposite ( viewContainer , from ) ;
139
139
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
+ }
140
145
}
141
146
142
147
private onViewDescriptorsAdded ( views : ReadonlyArray < IViewDescriptor > , container : ViewContainer ) : void {
You can’t perform that action at this time.
0 commit comments