提交 660f6bdc 编写于 作者: D Daniel Imms

Open restored files pinned

上级 f7ea530c
......@@ -174,7 +174,7 @@ export class Workbench implements IPartService {
// Restore any backups if they exist
options.filesToRestore = this.backupService.getBackupFiles(workspace.resource.fsPath).map(filePath => {
return { resource: Uri.file(filePath) };
return { resource: Uri.file(filePath), options: { pinned: true } };
});
this.hasFilesToCreateOpenOrDiff = (options.filesToCreate && options.filesToCreate.length > 0) || (options.filesToOpen && options.filesToOpen.length > 0) || (options.filesToDiff && options.filesToDiff.length > 0) || (options.filesToRestore.length > 0);
......@@ -328,7 +328,7 @@ export class Workbench implements IPartService {
let filesToRestoreInputPromise = filesToRestore.map(resourceInput => this.editorService.createInput(resourceInput, true));
return TPromise.join<EditorInput>(filesToOpenInputPromise.concat(filesToRestoreInputPromise)).then((inputsToOpen) => {
inputs.push(...inputsToOpen);
options.push(...filesToOpen.map(resourceInput => TextEditorOptions.from(resourceInput)));
options.push(...filesToOpen.concat(filesToRestore).map(resourceInput => TextEditorOptions.from(resourceInput)));
return inputs.map((input, index) => { return { input, options: options[index] }; });
});
......
......@@ -272,7 +272,8 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
return this.createTextEditorModel(restoreContent.value, content.resource).then(() => {
this.createTextEditorModelPromise = null;
this.setDirty(true); // Ensure we are not tracking a stale state
// TODO: This does not set the dirty indicator immediately, making it look like the file is not actually dirty
this.setDirty(true);
this.toDispose.push(this.textEditorModel.onDidChangeRawContent((e: IModelContentChangedEvent) => this.onModelContentChanged(e)));
return this;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册