mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
Pass regular untitled scheme file with small path to UntitledEditorInput
This commit is contained in:
@@ -157,9 +157,10 @@ export class UntitledEditorInput extends AbstractUntitledEditorInput {
|
||||
let restorePromise: TPromise<string>;
|
||||
if (this.hasBackupToRestore) {
|
||||
// TODO: Pass in only Untitled-x into the constructor, evaluate whether there is a backup here.
|
||||
const restoreResource = URI.from({ scheme: 'file', path: this.resource.fsPath });
|
||||
const restoreResource = this.backupFileService.getBackupResource(this.resource);
|
||||
restorePromise = this.textFileService.resolveTextContent(restoreResource).then(rawTextContent => rawTextContent.value.lines.join('\n'));
|
||||
this.resource = URI.from({ scheme: UntitledEditorInput.SCHEMA, path: paths.basename(this.resource.fsPath) });
|
||||
|
||||
// If the resource restored from backup it doesn't have an associated file path
|
||||
this.hasAssociatedFilePath = false;
|
||||
} else {
|
||||
restorePromise = TPromise.as('');
|
||||
|
||||
Reference in New Issue
Block a user