about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs
index 6d9c7a0d..ba485dc2 100644
--- a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs
+++ b/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs
@@ -6,7 +6,8 @@ use super::MappingTree;
 
 impl MappingTree {
     pub fn to_lf_mappings(self, home_path: PathBuf) -> String {
-        self.iter(true)
+        let mut raw = self
+            .iter(true)
             .map(|(key, value)| {
                 format!(
                     "map g{} cd \"{}\"\n",
@@ -14,6 +15,10 @@ impl MappingTree {
                     home_path.join(&value).display()
                 )
             })
-            .collect()
+            .collect::<Vec<String>>();
+
+        raw.sort();
+
+        raw.into_iter().collect()
     }
 }