Explorar el Código

Merge pull request #516 from VichoReyes/dothidden

Include symlinks to dirs when grouping dirs
Benjamin Sago hace 6 años
padre
commit
4dab6237f1
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      src/fs/filter.rs

+ 3 - 1
src/fs/filter.rs

@@ -129,7 +129,9 @@ impl FileFilter {
         if self.list_dirs_first {
         if self.list_dirs_first {
             // This relies on the fact that `sort_by` is *stable*: it will keep
             // This relies on the fact that `sort_by` is *stable*: it will keep
             // adjacent elements next to each other.
             // adjacent elements next to each other.
-            files.sort_by(|a, b| b.as_ref().is_directory().cmp(&a.as_ref().is_directory()));
+            files.sort_by(|a, b| {b.as_ref().points_to_directory()
+                .cmp(&a.as_ref().points_to_directory())
+            });
         }
         }
     }
     }
 }
 }