Browse Source

Merge pull request #6912 from jasongrout/itempath

Fix item path handling to consider drive names.
Ian Rose 5 years ago
parent
commit
8516d55cdf

+ 3 - 1
packages/filebrowser-extension/src/index.ts

@@ -528,11 +528,13 @@ function addCommands(
         return;
       }
 
+      const { contents } = widget.model.manager.services;
       return Promise.all(
         toArray(
           map(widget.selectedItems(), item => {
             if (item.type === 'directory') {
-              return widget.model.cd(`/${item.path}`);
+              const localPath = contents.localPath(item.path);
+              return widget.model.cd(`/${localPath}`);
             }
 
             return commands.execute('docmanager:open', {

+ 2 - 1
packages/filebrowser/src/listing.ts

@@ -921,8 +921,9 @@ export class DirListing extends Widget {
   private _handleOpen(item: Contents.IModel): void {
     this._onItemOpened.emit(item);
     if (item.type === 'directory') {
+      const localPath = this._manager.services.contents.localPath(item.path);
       this._model
-        .cd(`/${item.path}`)
+        .cd(`/${localPath}`)
         .catch(error => showErrorMessage('Open directory', error));
     } else {
       let path = item.path;