diff --git a/src/vs/workbench/parts/files/electron-browser/fileCommands.ts b/src/vs/workbench/parts/files/electron-browser/fileCommands.ts index 2e4edb6e5473d45c2623e81a74a2f8225033b031..5729f0571c85b0ca715c8fa35bb4f9136b95df31 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileCommands.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileCommands.ts @@ -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); diff --git a/src/vs/workbench/parts/preferences/browser/settingsEditor2.ts b/src/vs/workbench/parts/preferences/browser/settingsEditor2.ts index e68f38cf19031e6f5347c5aae63b8600547cefb8..2b9867a41b83f6ea8fdf3571216fe16d1d5c8339 100644 --- a/src/vs/workbench/parts/preferences/browser/settingsEditor2.ts +++ b/src/vs/workbench/parts/preferences/browser/settingsEditor2.ts @@ -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);