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

This commit is contained in:
Rob Lourens 2018-09-04 14:21:47 -07:00
parent 5e8acddb7a
commit ae6ed1414b
2 changed files with 8 additions and 10 deletions

View file

@ -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);
}
}

View file

@ -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');
}
});