Book/untitled file name updates (#8579)

* file-name has entire path as name, changes to address that

* await promises
This commit is contained in:
Maddy
2019-12-18 09:09:17 -08:00
committed by GitHub
parent a67e3abb4c
commit 746b4d7815
3 changed files with 8 additions and 18 deletions

View File

@@ -290,13 +290,8 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
getUntitledNotebookUri(resource: string): vscode.Uri {
let untitledFileName: vscode.Uri;
if (process.platform === 'win32') {
let title = path.join(path.dirname(resource), this.findNextUntitledFileName(resource));
untitledFileName = vscode.Uri.parse(`untitled:${title}`);
}
else {
untitledFileName = vscode.Uri.parse(resource).with({ scheme: 'untitled' });
}
let nextTitle: string = this.findNextUntitledFileName(resource);
untitledFileName = vscode.Uri.parse(`untitled:${nextTitle}`);
if (!this.currentBook.getAllBooks().get(untitledFileName.fsPath) && !this.currentBook.getAllBooks().get(path.basename(untitledFileName.fsPath))) {
let notebook = this.currentBook.getAllBooks().get(resource);
this.currentBook.getAllBooks().set(path.basename(untitledFileName.fsPath), notebook);