提交 d7462ba9 编写于 作者: R Rob Lourens 提交者: GitHub

Merge pull request #29261 from keegancsmith/pref-filter

Filter settings from no search results link
......@@ -168,7 +168,10 @@ export class PreferencesEditor extends BaseEditor {
this.searchWidget.focus();
}
public focusSearch(): void {
public focusSearch(filter?: string): void {
if (filter !== null) {
this.searchWidget.setValue(filter);
}
this.searchWidget.focus();
}
......
......@@ -61,6 +61,7 @@ import { attachListStyler } from 'vs/platform/theme/common/styler';
import { IOutputService } from 'vs/workbench/parts/output/common/output';
import { Color } from 'vs/base/common/color';
import { getOutOfWorkspaceEditorResources } from 'vs/workbench/parts/search/common/search';
import { PreferencesEditor } from "vs/workbench/parts/preferences/browser/preferencesEditor";
export class SearchViewlet extends Viewlet {
......@@ -1081,11 +1082,12 @@ export class SearchViewlet extends Viewlet {
}).on(dom.EventType.CLICK, (e: MouseEvent) => {
dom.EventHelper.stop(e, false);
if (this.contextService.hasWorkspace()) {
this.preferencesService.openWorkspaceSettings().done(() => null, errors.onUnexpectedError);
} else {
this.preferencesService.openGlobalSettings().done(() => null, errors.onUnexpectedError);
}
let editorPromise = this.contextService.hasWorkspace() ? this.preferencesService.openWorkspaceSettings() : this.preferencesService.openGlobalSettings();
editorPromise.done(editor => {
if (editor instanceof PreferencesEditor) {
editor.focusSearch('.exclude');
}
}, errors.onUnexpectedError);
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册