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 {
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
Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments