diff --git a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts index e5fff92bdaef..47ea71b6a66c 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts @@ -253,7 +253,8 @@ class Controller extends WorkbenchTreeController { } var result = super.onClick(tree, element, event); - if (event.ctrlKey || event.metaKey || event.altKey) { + var openToSide = event.ctrlKey || event.metaKey || event.altKey; + if (openToSide && (isDoubleClick || this.openOnSingleClick)) { this._onDidOpenToSide.fire(element); } else if (isDoubleClick) { this._onDidSelect.fire(element); diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 4ee33117750a..8757035031d5 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -6,7 +6,7 @@ import { ITree, ITreeConfiguration, ITreeOptions } from 'vs/base/parts/tree/browser/tree'; import { List, IListOptions, isSelectionRangeChangeEvent, isSelectionSingleChangeEvent, IMultipleSelectionController, IOpenController } from 'vs/base/browser/ui/list/listWidget'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IDisposable, toDisposable, combinedDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { IContextKeyService, IContextKey, RawContextKey, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { PagedList, IPagedRenderer } from 'vs/base/browser/ui/list/listPaging'; @@ -20,7 +20,7 @@ import { mixin } from 'vs/base/common/objects'; import { localize } from 'vs/nls'; import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { DefaultController, IControllerOptions, OpenMode } from 'vs/base/parts/tree/browser/treeDefaults'; +import { DefaultController, IControllerOptions, OpenMode, ClickBehavior } from 'vs/base/parts/tree/browser/treeDefaults'; import { isUndefinedOrNull } from 'vs/base/common/types'; import { IEditorOptions } from 'vs/platform/editor/common/editor'; import Event, { Emitter } from 'vs/base/common/event'; @@ -141,7 +141,7 @@ class OpenController implements IOpenController { } function handleListControllers(options: IListOptions, configurationService: IConfigurationService): IListOptions { - if (options.multipleSelectionSupport === true && !options.multipleSelectionController) { + if (options.multipleSelectionSupport !== false && !options.multipleSelectionController) { options.multipleSelectionController = new MultipleSelectionController(configurationService); } @@ -150,6 +150,14 @@ function handleListControllers(options: IListOptions, configurationService return options; } +function handleTreeController(configuration: ITreeConfiguration, instantiationService: IInstantiationService): ITreeConfiguration { + if (!configuration.controller) { + configuration.controller = instantiationService.createInstance(WorkbenchTreeController, { clickBehavior: ClickBehavior.ON_MOUSE_UP }); + } + + return configuration; +} + export class WorkbenchList extends List { readonly contextKeyService: IContextKeyService; @@ -266,9 +274,10 @@ export class WorkbenchTree extends Tree { @IContextKeyService contextKeyService: IContextKeyService, @IListService listService: IListService, @IThemeService themeService: IThemeService, + @IInstantiationService instantiationService: IInstantiationService, @IConfigurationService private configurationService: IConfigurationService ) { - super(container, configuration, mixin(options, { keyboardSupport: false } as ITreeOptions, false)); + super(container, handleTreeController(configuration, instantiationService), mixin(options, { keyboardSupport: false } as ITreeOptions, false)); this.contextKeyService = createScopedContextKeyService(contextKeyService, this); this.listDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); diff --git a/src/vs/workbench/browser/parts/views/viewsViewlet.ts b/src/vs/workbench/browser/parts/views/viewsViewlet.ts index 0e90dbc87726..8e22161b5bb7 100644 --- a/src/vs/workbench/browser/parts/views/viewsViewlet.ts +++ b/src/vs/workbench/browser/parts/views/viewsViewlet.ts @@ -773,9 +773,10 @@ export class FileIconThemableWorkbenchTree extends WorkbenchTree { @IContextKeyService contextKeyService: IContextKeyService, @IListService listService: IListService, @IThemeService themeService: IWorkbenchThemeService, - @IConfigurationService configurationService: IConfigurationService + @IConfigurationService configurationService: IConfigurationService, + @IInstantiationService instantiationService: IInstantiationService ) { - super(container, configuration, { ...options, ...{ showTwistie: false, twistiePixels: 12 } }, contextKeyService, listService, themeService, configurationService); + super(container, configuration, { ...options, ...{ showTwistie: false, twistiePixels: 12 } }, contextKeyService, listService, themeService, instantiationService, configurationService); DOM.addClass(container, 'file-icon-themable-tree'); DOM.addClass(container, 'show-file-icons');