提交 ae6ed141 编写于 作者: R Rob Lourens

Fix #57727 - show exclude settings in new UI when opening from search viewlet

上级 5e8acddb
......@@ -231,7 +231,11 @@ export class SettingsEditor2 extends BaseEditor {
}
}
focusSearch(): void {
focusSearch(filter?: string): void {
if (filter && this.searchWidget) {
this.searchWidget.setValue(filter);
}
this.searchWidget.focus();
}
......@@ -239,13 +243,6 @@ export class SettingsEditor2 extends BaseEditor {
this.searchWidget.setValue('');
}
search(text: string): void {
if (this.searchWidget) {
this.searchWidget.focus();
this.searchWidget.setValue(text);
}
}
private createHeader(parent: HTMLElement): void {
this.headerContainer = DOM.append(parent, $('.settings-header'));
......@@ -1143,7 +1140,7 @@ class FilterByTagAction extends Action {
}
run(): TPromise<void> {
this.settingsEditor.search(this.tag === MODIFIED_SETTING_TAG ? `@${this.tag} ` : `@tag:${this.tag} `);
this.settingsEditor.focusSearch(this.tag === MODIFIED_SETTING_TAG ? `@${this.tag} ` : `@tag:${this.tag} `);
return TPromise.as(null);
}
}
......@@ -61,6 +61,7 @@ import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { SettingsEditor2 } from 'vs/workbench/parts/preferences/browser/settingsEditor2';
const $ = dom.$;
......@@ -1247,7 +1248,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
let editorPromise = this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY ? this.preferencesService.openWorkspaceSettings() : this.preferencesService.openGlobalSettings();
editorPromise.then(editor => {
if (editor instanceof PreferencesEditor) {
if (editor instanceof PreferencesEditor || editor instanceof SettingsEditor2) {
editor.focusSearch('.exclude');
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册