Parcourir la source

Add entries when importing, instead of remplacing

 + Entries from old rc file are prepended to entries in the new one. It’s a
 better behavior than remplacing with new entries, which was done before.
Leo il y a 8 ans
Parent
commit
0e5b0d4c34
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/rc.ml

+ 1 - 1
src/rc.ml

@@ -312,7 +312,7 @@ let import ~from ~to_file =
   let imported_rc : t = init ~rc:to_file () in
   let imported_rc : t = init ~rc:to_file () in
   let to_import : File_com.t = File_com.init_rc ~rc:from () in
   let to_import : File_com.t = File_com.init_rc ~rc:from () in
   to_import.progs |> List.map ~f:(fun command -> new entry command)
   to_import.progs |> List.map ~f:(fun command -> new entry command)
-  |> imported_rc#change_entries
+  |> imported_rc#add_entries
   |> fun rc -> rc#write;
   |> fun rc -> rc#write;
   Messages.ok "Import successful!";
   Messages.ok "Import successful!";
   sprintf "from: %s; to: %s" (Lazy.force from) (Lazy.force to_file)
   sprintf "from: %s; to: %s" (Lazy.force from) (Lazy.force to_file)