Fix #132271

Fix #130412
上级 ad67ad45
......@@ -209,6 +209,7 @@ export class IncludePatternInputWidget extends PatternInputWidget {
setOnlySearchInOpenEditors(value: boolean) {
this.useSearchInEditorsBox.checked = value;
this._onChangeSearchInEditorsBoxEmitter.fire();
}
protected override getSubcontrolsWidth(): number {
......
......@@ -505,7 +505,7 @@ export class SearchView extends ViewPane {
private refreshAndUpdateCount(event?: IChangeEvent): void {
this.searchWidget.setReplaceAllActionState(!this.viewModel.searchResult.isEmpty());
this.updateSearchResultCount(this.viewModel.searchResult.query!.userDisabledExcludesAndIgnoreFiles);
this.updateSearchResultCount(this.viewModel.searchResult.query!.userDisabledExcludesAndIgnoreFiles, this.viewModel.searchResult.query?.onlyOpenEditors);
return this.refreshTree(event);
}
......@@ -1600,7 +1600,12 @@ export class SearchView extends ViewPane {
this.searchExcludePattern.setUseExcludesAndIgnoreFiles(true);
}
private updateSearchResultCount(disregardExcludesAndIgnores?: boolean): void {
private onDisableSearchInOpenEditors(): void {
this.toggleQueryDetails(false, true);
this.inputPatternIncludes.setOnlySearchInOpenEditors(false);
}
private updateSearchResultCount(disregardExcludesAndIgnores?: boolean, onlyOpenEditors?: boolean): void {
const fileCount = this.viewModel.searchResult.fileCount();
this.hasSearchResultsKey.set(fileCount > 0);
......@@ -1618,6 +1623,12 @@ export class SearchView extends ViewPane {
dom.append(messageEl, $('span', undefined, excludesDisabledMessage, '(', enableExcludesButton.element, ')'));
}
if (onlyOpenEditors) {
const searchingInOpenMessage = ' - ' + nls.localize('onlyOpenEditors', "searching only in open files") + ' ';
const disableOpenEditorsButton = this.messageDisposables.add(new SearchLinkButton(nls.localize('openEditors.disable', "disable"), this.onDisableSearchInOpenEditors.bind(this), nls.localize('disableOpenEditors', "Search in entire workspace")));
dom.append(messageEl, $('span', undefined, searchingInOpenMessage, '(', disableOpenEditorsButton.element, ')'));
}
dom.append(messageEl, ' - ');
const openInEditorTooltip = appendKeyBindingLabel(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册