Add history to search editor
This commit is contained in:
parent
8d8645ea54
commit
9cf8dc0579
1 changed files with 8 additions and 0 deletions
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue