提交 c200ab4d 编写于 作者: I isidor

fix save all for untitiled

上级 b8282545
......@@ -188,8 +188,15 @@ function saveAll(saveAllArguments: any, editorService: INextEditorService, untit
});
// Save all
return textFileService.saveAll(saveAllArguments).then(() => {
return textFileService.saveAll(saveAllArguments).then((result) => {
groupIdToUntitledResourceInput.forEach((inputs, groupId) => {
// Update untitled resources to the saved ones, so we open the proper files
inputs.forEach(i => {
const targetResult = result.results.filter(r => r.success && r.source.toString() === i.resource.toString()).pop();
if (targetResult) {
i.resource = targetResult.target;
}
});
editorService.openEditors(inputs, groupId);
});
});
......
......@@ -111,18 +111,20 @@ export class OpenEditorsView extends ViewsViewletPanel {
this.listRefreshScheduler.schedule(this.structuralRefreshDelay);
};
const groupDisposables = new Map<number, IDisposable[]>();
this.disposables.push(this.editorGroupService.onDidAddGroup(() => updateWholeList()));
this.disposables.push(this.editorGroupService.onDidAddGroup(group => {
const toDispose = [];
groupDisposables.set(group.id, toDispose);
updateWholeList();
}));
this.disposables.push(this.editorGroupService.onDidMoveGroup(() => updateWholeList()));
this.disposables.push(this.editorGroupService.onDidRemoveGroup(() => updateWholeList()));
this.disposables.push(this.editorGroupService.onDidRemoveGroup(group => {
dispose(groupDisposables.get(group.id));
updateWholeList();
}));
// TODO@isidor react on editor events
// this.disposables.push(this.editorService.onWillCloseEditor(e => {
// const group = this.editorGroupService.getGroup(e.groupId);
// const index = this.getIndex(group, e.editor);
// this.list.splice(index, 1);
// }));
// this.editorService.onWillOpenEditor(
// this.disposables.push(this.editorService.onDidActiveEditorChange(() => this.focusActiveEditor()));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册