Merge pull request #59797 from J-Graham/middle-click-breadcrumbs

Fixes for 58176: Middle clicking files in breadcrumbs explorer opens …
This commit is contained in:
Johannes Rieken 2018-10-05 10:29:36 +02:00 committed by GitHub
commit 3dc960c0d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -323,7 +323,7 @@ export class BreadcrumbsControl {
editorViewState = undefined;
}
this._contextViewService.hideContextView(this);
this._revealInEditor(event, data.target, this._getEditorGroup(data.payload && data.payload.originalEvent));
this._revealInEditor(event, data.target, this._getEditorGroup(data.payload && data.payload.originalEvent), (data.payload && data.payload.originalEvent.middleButton));
/* __GDPR__
"breadcrumbs/open" : {
"type": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
@ -406,11 +406,11 @@ export class BreadcrumbsControl {
this._ckBreadcrumbsActive.set(value);
}
private _revealInEditor(event: IBreadcrumbsItemEvent, element: any, group: SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): void {
private _revealInEditor(event: IBreadcrumbsItemEvent, element: any, group: SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE, pinned: boolean = false): void {
if (element instanceof FileElement) {
if (element.kind === FileKind.FILE) {
// open file in any editor
this._editorService.openEditor({ resource: element.uri }, group);
this._editorService.openEditor({ resource: element.uri, options: { pinned: pinned } }, group);
} else {
// show next picker
let items = this._widget.getItems();