Skip to content

Commit

Permalink
prevent scm from moving on startup (#99692)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbatten authored Jun 9, 2020
1 parent d53378d commit 1968b78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/vs/workbench/browser/parts/compositeBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export class CompositeDragAndDrop implements ICompositeDragAndDrop {
const draggedViews = this.viewDescriptorService.getViewContainerModel(currentContainer)!.allViewDescriptors;

// ... all views must be movable
return !draggedViews.some(v => !v.canMoveView);
// Prevent moving scm explicitly TODO@joaomoreno remove when scm is moveable
return !draggedViews.some(v => !v.canMoveView) && currentContainer.id !== 'workbench.view.scm';
} else {
// Dragging an individual view
const viewDescriptor = this.viewDescriptorService.getViewDescriptorById(dragData.id);
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/browser/parts/views/viewPaneContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
const container = this.viewDescriptorService.getViewContainerById(dropData.id)!;
const viewsToMove = this.viewDescriptorService.getViewContainerModel(container).allViewDescriptors;

if (!viewsToMove.some(v => !v.canMoveView)) {
if (!viewsToMove.some(v => !v.canMoveView) && viewsToMove.length > 0) {
overlay = new ViewPaneDropOverlay(parent, undefined, this.viewDescriptorService.getViewContainerLocation(this.viewContainer)!, this.themeService);
}
}
Expand Down Expand Up @@ -1353,7 +1353,7 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
const container = this.viewDescriptorService.getViewContainerById(dropData.id)!;
const viewsToMove = this.viewDescriptorService.getViewContainerModel(container).allViewDescriptors;

if (!viewsToMove.some(v => !v.canMoveView)) {
if (!viewsToMove.some(v => !v.canMoveView) && viewsToMove.length > 0) {
overlay = new ViewPaneDropOverlay(pane.dropTargetElement, this.orientation ?? Orientation.VERTICAL, this.viewDescriptorService.getViewContainerLocation(this.viewContainer)!, this.themeService);
}
}
Expand Down

0 comments on commit 1968b78

Please sign in to comment.