提交 5273e205 编写于 作者: B Benjamin Pasero

editors - save/revert through service

上级 3e777d8e
......@@ -543,13 +543,13 @@ export class RevertAndCloseEditorAction extends Action {
// first try a normal revert where the contents of the editor are restored
try {
await editor.revert(group.id);
await this.editorService.revert({ editor, groupId: group.id });
} catch (error) {
// if that fails, since we are about to close the editor, we accept that
// the editor cannot be reverted and instead do a soft revert that just
// enables us to close the editor. With this, a user can always close a
// dirty editor even when reverting fails.
await editor.revert(group.id, { soft: true });
await this.editorService.revert({ editor, groupId: group.id }, { soft: true });
}
group.closeEditor(editor);
......
......@@ -252,7 +252,7 @@ export class PreferencesEditor extends BaseEditor {
if (this.editorService.activeControl !== this) {
this.focus();
}
const promise: Promise<boolean> = this.input && this.input.isDirty() ? this.input.save(this.group!.id).then(editor => !!editor) : Promise.resolve(true);
const promise: Promise<boolean> = this.input && this.input.isDirty() ? this.editorService.save({ editor: this.input, groupId: this.group!.id }) : Promise.resolve(true);
promise.then(() => {
if (target === ConfigurationTarget.USER_LOCAL) {
this.preferencesService.switchSettings(ConfigurationTarget.USER_LOCAL, this.preferencesService.userSettingsResource, true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册