提交 fc739fed 编写于 作者: J Jackson Kearl

Notify no need to save on save

上级 cb366e28
......@@ -42,6 +42,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { ILabelService } from 'vs/platform/label/common/label';
import { SettingsEditor2 } from 'vs/workbench/parts/preferences/browser/settingsEditor2';
// Commands
......@@ -161,6 +162,11 @@ function save(
// Just save
return textFileService.save(resource, { force: true /* force a change to the file to trigger external watchers if any */ });
} else if (resource && resource.scheme === Schemas.vscode) {
const activeControl = editorService.activeControl;
if (activeControl instanceof SettingsEditor2) {
activeControl.notifyNoSaveNeeded();
}
}
return TPromise.as(false);
......
......@@ -488,11 +488,15 @@ export class SettingsEditor2 extends BaseEditor {
}));
}
private onDidChangeSetting(key: string, value: any): void {
if (!this.storageService.getBoolean('hasNotifiedOfSettingsAutosave', StorageScope.GLOBAL, false)) {
public notifyNoSaveNeeded(force: boolean = true) {
if (force || !this.storageService.getBoolean('hasNotifiedOfSettingsAutosave', StorageScope.GLOBAL, false)) {
this.storageService.store('hasNotifiedOfSettingsAutosave', true, StorageScope.GLOBAL);
this.notificationService.info(localize('settingsNoSaveNeeded', "Your changes are automatically saved as you edit."));
}
}
private onDidChangeSetting(key: string, value: any): void {
this.notifyNoSaveNeeded(false);
if (this.pendingSettingUpdate && this.pendingSettingUpdate.key !== key) {
this.updateChangedSetting(key, value);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册