From e78db47121fafc8d62895404b3cca6b0045cf8d7 Mon Sep 17 00:00:00 2001 From: iBlackShadow Date: Sun, 28 Oct 2018 14:02:06 -0600 Subject: [PATCH 1/3] Add an entry to the search history when the search was triggered by an option change --- src/vs/workbench/parts/search/browser/searchView.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index 02c5c1522340a..75f032091f22f 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -324,7 +324,10 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { this._register(this.searchWidget.onSearchSubmit(() => this.onQueryChanged())); this._register(this.searchWidget.onSearchCancel(() => this.cancelSearch())); - this._register(this.searchWidget.searchInput.onDidOptionChange(() => this.onQueryChanged(true))); + this._register(this.searchWidget.searchInput.onDidOptionChange(() => { + this.searchWidget.searchInput.inputBox.addToHistory(); + this.onQueryChanged(true); + })); this._register(this.searchWidget.onReplaceToggled(() => this.onReplaceToggled())); this._register(this.searchWidget.onReplaceStateChange((state) => { From 3863030994668e7865c6c3b45c4f30f346e646b6 Mon Sep 17 00:00:00 2001 From: iBlackShadow Date: Sun, 11 Nov 2018 12:41:43 -0600 Subject: [PATCH 2/3] Add an entry to the search history every time a search is done --- src/vs/base/browser/ui/findinput/findInput.ts | 4 ++++ src/vs/workbench/parts/search/browser/searchView.ts | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vs/base/browser/ui/findinput/findInput.ts b/src/vs/base/browser/ui/findinput/findInput.ts index 4ab22a349e437..0ba7da016be15 100644 --- a/src/vs/base/browser/ui/findinput/findInput.ts +++ b/src/vs/base/browser/ui/findinput/findInput.ts @@ -181,6 +181,10 @@ export class FindInput extends Widget { } } + public onSearchSubmit(): void { + this.inputBox.addToHistory(); + } + public style(styles: IFindInputStyles): void { this.inputActiveOptionBorder = styles.inputActiveOptionBorder; this.inputBackground = styles.inputBackground; diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index 75f032091f22f..6065949346b92 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -324,10 +324,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { this._register(this.searchWidget.onSearchSubmit(() => this.onQueryChanged())); this._register(this.searchWidget.onSearchCancel(() => this.cancelSearch())); - this._register(this.searchWidget.searchInput.onDidOptionChange(() => { - this.searchWidget.searchInput.inputBox.addToHistory(); - this.onQueryChanged(true); - })); + this._register(this.searchWidget.searchInput.onDidOptionChange(() => this.onQueryChanged(true))); this._register(this.searchWidget.onReplaceToggled(() => this.onReplaceToggled())); this._register(this.searchWidget.onReplaceStateChange((state) => { @@ -1115,6 +1112,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { } private onQueryTriggered(query: ITextQuery, excludePatternText: string, includePatternText: string): void { + this.searchWidget.searchInput.onSearchSubmit(); this.inputPatternExcludes.onSearchSubmit(); this.inputPatternIncludes.onSearchSubmit(); From 57336b335a801e8e6be7ec966404c38009c32304 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Mon, 12 Nov 2018 10:57:44 -0800 Subject: [PATCH 3/3] Format searchView.ts --- src/vs/workbench/parts/search/browser/searchView.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index 272c7f3f4580a..622455f851e4b 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -1109,7 +1109,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { } private onQueryTriggered(query: ITextQuery, options: ITextQueryBuilderOptions, excludePatternText: string, includePatternText: string): void { - this.searchWidget.searchInput.onSearchSubmit(); + this.searchWidget.searchInput.onSearchSubmit(); this.inputPatternExcludes.onSearchSubmit(); this.inputPatternIncludes.onSearchSubmit();