emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 2a5d3fc 05/12: Fix double-sorting for file names


From: Oleh Krehel
Subject: [elpa] master 2a5d3fc 05/12: Fix double-sorting for file names
Date: Tue, 21 Apr 2015 12:09:21 +0000

branch: master
commit 2a5d3fc16d12ad14a13bf70d78fa3d391b28af8f
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Fix double-sorting for file names
    
    * ivy.el (ivy--sorted-files): Update.
    (ivy-read): Update.
---
 ivy.el |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ivy.el b/ivy.el
index c81658a..d25fbce 100644
--- a/ivy.el
+++ b/ivy.el
@@ -336,7 +336,13 @@ Directories come first."
         (setq seq (cl-sort seq sort-fn)))
       (dolist (dir ivy-extra-directories)
         (push dir seq))
-      (or seq '("" "")))))
+      (cl-case (length seq)
+        (0
+         '("" ""))
+        (1
+         (cons "" seq))
+        (t
+         seq)))))
 
 ;;** Entry Point
 (defun ivy-read (prompt collection
@@ -385,9 +391,9 @@ When SORT is t, refer to `ivy-sort-functions-alist' for 
sorting."
            (setq coll collection)))
     (when sort
       (if (and (functionp collection)
-               (not (eq collection 'read-file-name-internal))
                (setq sort-fn (assoc collection ivy-sort-functions-alist)))
-          (when (setq sort-fn (cdr sort-fn))
+          (when (and (setq sort-fn (cdr sort-fn))
+                     (not (eq collection 'read-file-name-internal)))
             (setq coll (cl-sort coll sort-fn)))
         (if (and (setq sort-fn (cdr (assoc t ivy-sort-functions-alist)))
                  (<= (length coll) ivy-sort-max-size))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]