Skip to content

Commit d9eadda

Browse files
author
Jackson Kearl
committed
Add command to rerun search editor query
1 parent 2402d70 commit d9eadda

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/vs/workbench/contrib/searchEditor/browser/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const ToggleSearchEditorCaseSensitiveCommandId = 'toggleSearchEditorCaseS
1212
export const ToggleSearchEditorWholeWordCommandId = 'toggleSearchEditorWholeWord';
1313
export const ToggleSearchEditorRegexCommandId = 'toggleSearchEditorRegex';
1414
export const ToggleSearchEditorContextLinesCommandId = 'toggleSearchEditorContextLines';
15+
export const RerunSearchEditorSearchCommandId = 'rerunSearchEditorSearch';
1516

1617
export const InSearchEditor = new RawContextKey<boolean>('inSearchEditor', false);
1718

src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
145145
primary: KeyMod.Alt | KeyCode.KEY_L,
146146
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_L }
147147
});
148+
149+
CommandsRegistry.registerCommand(
150+
SearchEditorConstants.RerunSearchEditorSearchCommandId,
151+
(accessor: ServicesAccessor) => {
152+
const activeControl = accessor.get(IEditorService).activeControl;
153+
if (activeControl instanceof SearchEditor) {
154+
activeControl.triggerSearch({ resetCursor: false });
155+
}
156+
});
148157
//#endregion
149158

150159
//#region Actions

0 commit comments

Comments
 (0)