diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts b/packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts index a432a46505702..4511620eae958 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts +++ b/packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts @@ -20,7 +20,7 @@ import { } from '@theia/core/lib/browser'; import { SearchInWorkspaceWidget } from './search-in-workspace-widget'; import { injectable, inject, postConstruct } from '@theia/core/shared/inversify'; -import { CommandRegistry, MenuModelRegistry, SelectionService, Command } from '@theia/core'; +import { CommandRegistry, MenuModelRegistry, SelectionService, Command, isOSX } from '@theia/core'; import { codicon, Widget } from '@theia/core/lib/browser/widgets'; import { FileNavigatorCommands, NavigatorContextMenu } from '@theia/navigator/lib/browser/navigator-contribution'; import { UriCommandHandler, UriAwareCommandHandler } from '@theia/core/lib/common/uri-command-handler'; @@ -218,7 +218,9 @@ export class SearchInWorkspaceFrontendContribution extends AbstractViewContribut execute: () => this.withWidget(undefined, widget => { const { selection } = this.selectionService; if (TreeWidgetSelection.is(selection)) { - widget.resultTreeWidget.removeNode(selection[0]); + for (const selected of selection) { + widget.resultTreeWidget.removeNode(selected); + } } }) }); @@ -303,6 +305,16 @@ export class SearchInWorkspaceFrontendContribution extends AbstractViewContribut keybinding: 'shift+alt+f', when: 'explorerResourceIsFolder' }); + keybindings.registerKeybinding({ + command: SearchInWorkspaceCommands.DISMISS_RESULT.id, + keybinding: isOSX ? 'cmd+backspace' : 'del', + when: 'searchViewletFocus && !inputBoxFocus' + }); + keybindings.registerKeybinding({ + command: SearchInWorkspaceCommands.COPY_ONE.id, + keybinding: 'ctrlcmd+c', + when: 'searchViewletFocus && !inputBoxFocus' + }); } override registerMenus(menus: MenuModelRegistry): void { diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-frontend-module.ts b/packages/search-in-workspace/src/browser/search-in-workspace-frontend-module.ts index f7e05bc371280..39aeecdbd102e 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-frontend-module.ts +++ b/packages/search-in-workspace/src/browser/search-in-workspace-frontend-module.ts @@ -74,6 +74,7 @@ export function createSearchTreeWidget(parent: interfaces.Container): SearchInWo widget: SearchInWorkspaceResultTreeWidget, props: { contextMenuPath: SearchInWorkspaceResultTreeWidget.Menus.BASE, + multiSelect: true, globalSelection: true } });