提交 46c9a3cd 编写于 作者: B Benjamin Pasero

Allow to pin an editor when saving explicitly (fixes #20466)

上级 2547faa2
......@@ -1330,6 +1330,7 @@ export abstract class BaseSaveFileAction extends BaseActionWithErrorReporting {
label: string,
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@ITextFileService private textFileService: ITextFileService,
@IEditorGroupService private editorGroupService: IEditorGroupService,
@IUntitledEditorService private untitledEditorService: IUntitledEditorService,
@IMessageService messageService: IMessageService
) {
......@@ -1412,6 +1413,14 @@ export abstract class BaseSaveFileAction extends BaseActionWithErrorReporting {
});
}
// Pin the active editor if we are saving it
if (!this.resource) {
const editor = this.editorService.getActiveEditor();
if (editor) {
this.editorGroupService.pinEditor(editor.position, editor.input);
}
}
// Just save
return this.textFileService.save(source, { force: true /* force a change to the file to trigger external watchers if any */ });
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册