Add history to search editor

This commit is contained in:
Jackson Kearl 2020-01-16 17:03:38 -08:00
parent 8d8645ea54
commit 9cf8dc0579

View file

@ -65,6 +65,7 @@ export class SearchEditor extends BaseEditor {
private inSearchEditorContextKey: IContextKey<boolean>;
private inputFocusContextKey: IContextKey<boolean>;
private searchOperation: LongRunningOperation;
private searchHistoryDelayer: Delayer<void>;
constructor(
@ITelemetryService telemetryService: ITelemetryService,
@ -85,6 +86,7 @@ export class SearchEditor extends BaseEditor {
this.inSearchEditorContextKey = InSearchEditor.bindTo(contextKeyService);
this.inputFocusContextKey = InputBoxFocusedKey.bindTo(contextKeyService);
this.searchOperation = this._register(new LongRunningOperation(progressService));
this.searchHistoryDelayer = new Delayer<void>(2000);
}
createEditor(parent: HTMLElement) {
@ -240,6 +242,12 @@ export class SearchEditor extends BaseEditor {
private async doRunSearch() {
const startInput = this.input;
this.searchHistoryDelayer.trigger(() => {
this.queryEditorWidget.searchInput.onSearchSubmit();
this.inputPatternExcludes.onSearchSubmit();
this.inputPatternIncludes.onSearchSubmit();
});
const config: SearchConfiguration = {
caseSensitive: this.queryEditorWidget.searchInput.getCaseSensitive(),
contextLines: this.queryEditorWidget.contextLines(),