提交 d4f993de 编写于 作者: B Benjamin Pasero

Saving an untitled file closes it (fix #114272)

上级 e44fb4ab
......@@ -220,8 +220,13 @@ export abstract class AbstractTextResourceEditorInput extends EditorInput implem
return undefined; // save cancelled
}
// If the target is a different resource (from "Save As" operation), return with a new editor input
if (saveAs && !isEqual(target, this.preferredResource)) {
// If this save operation results in a new editor, either
// because it was saved to disk (e.g. from untitled) or
// through an explicit "Save As", make sure to replace it.
if (
target.scheme !== this.resource.scheme ||
(saveAs && !isEqual(target, this.preferredResource))
) {
return this.editorService.createEditorInput({ resource: target });
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册