Procházet zdrojové kódy

Fix item path handling to consider drive names.

This fixes problems from #6841 and #6900 and supersedes #6905.
Jason Grout před 5 roky
rodič
revize
d6e2d86cff

+ 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;