highlight correct notebook on navigation. (#10807)

* highlight correct notebook on navigation.

* add back behavior of highight on viewlet visible

* optimize bookViewer create

* createTreeView for every book
This commit is contained in:
Maddy
2020-06-08 19:09:43 -07:00
committed by GitHub
parent 252c31bd5d
commit 22d7c9083e
3 changed files with 14 additions and 7 deletions

View File

@@ -51,7 +51,7 @@ export class BookModel implements azdata.nb.NavigationProvider {
}
public getNotebook(uri: string): BookTreeItem | undefined {
return this._allNotebooks.get(uri);
return this._allNotebooks.get(this.openAsUntitled ? path.basename(uri) : uri);
}
public async loadTableOfContentFiles(folderPath: string): Promise<void> {
@@ -190,8 +190,8 @@ export class BookModel implements azdata.nb.NavigationProvider {
if (this.openAsUntitled) {
if (!this._allNotebooks.get(path.basename(pathToNotebook))) {
this._allNotebooks.set(path.basename(pathToNotebook), notebook);
notebooks.push(notebook);
}
notebooks.push(notebook);
} else {
// convert to URI to avoid casing issue with drive letters when getting navigation links
let uriToNotebook: vscode.Uri = vscode.Uri.file(pathToNotebook);