Skip to content

Commit

Permalink
Add ctrl-shift-F searches to history
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Bodeen <[email protected]>
  • Loading branch information
gbodeen committed Nov 19, 2021
1 parent 07aacaa commit d6b75ec
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidge
const values = Array.from(new Set(uris.map(uri => `${uri}/**`)));
const value = values.join(', ');
this.searchInWorkspaceOptions.include = values;
const include = document.getElementById('include-glob-field');
if (include) {
(include as HTMLInputElement).value = value;
if (this.includeRef.current) {
this.includeRef.current.value = value;
this.includeRef.current.addToHistory();
}
this.update();
}
Expand All @@ -234,9 +234,9 @@ export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidge
*/
updateSearchTerm(term: string, showReplaceField?: boolean): void {
this.searchTerm = term;
const search = document.getElementById('search-input-field');
if (search) {
(search as HTMLInputElement).value = term;
if (this.searchRef.current) {
this.searchRef.current.value = term;
this.searchRef.current.addToHistory();
}
if (showReplaceField) {
this.showReplaceField = true;
Expand Down Expand Up @@ -284,15 +284,17 @@ export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidge
this.matchCaseState.enabled = false;
this.wholeWordState.enabled = false;
this.regExpState.enabled = false;
const search = document.getElementById('search-input-field');
const replace = document.getElementById('replace-input-field');
const include = document.getElementById('include-glob-field');
const exclude = document.getElementById('exclude-glob-field');
if (search && replace && include && exclude) {
(search as HTMLInputElement).value = '';
(replace as HTMLInputElement).value = '';
(include as HTMLInputElement).value = '';
(exclude as HTMLInputElement).value = '';
if (this.searchRef.current) {
this.searchRef.current.value = '';
}
if (this.replaceRef.current) {
this.replaceRef.current.value = '';
}
if (this.includeRef.current) {
this.includeRef.current.value = '';
}
if (this.excludeRef.current) {
this.excludeRef.current.value = '';
}
this.performSearch();
this.update();
Expand Down

0 comments on commit d6b75ec

Please sign in to comment.