Add command to rerun search editor query

This commit is contained in:
Jackson Kearl
2020-02-21 16:34:56 -08:00
parent 2402d70ae9
commit d9eaddaee1
2 changed files with 10 additions and 0 deletions
@@ -12,6 +12,7 @@ export const ToggleSearchEditorCaseSensitiveCommandId = 'toggleSearchEditorCaseS
export const ToggleSearchEditorWholeWordCommandId = 'toggleSearchEditorWholeWord';
export const ToggleSearchEditorRegexCommandId = 'toggleSearchEditorRegex';
export const ToggleSearchEditorContextLinesCommandId = 'toggleSearchEditorContextLines';
export const RerunSearchEditorSearchCommandId = 'rerunSearchEditorSearch';
export const InSearchEditor = new RawContextKey<boolean>('inSearchEditor', false);
@@ -145,6 +145,15 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
primary: KeyMod.Alt | KeyCode.KEY_L,
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_L }
});
CommandsRegistry.registerCommand(
SearchEditorConstants.RerunSearchEditorSearchCommandId,
(accessor: ServicesAccessor) => {
const activeControl = accessor.get(IEditorService).activeControl;
if (activeControl instanceof SearchEditor) {
activeControl.triggerSearch({ resetCursor: false });
}
});
//#endregion
//#region Actions