]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el (ivy--sort-files-by-date): Fix due to destructive cl-sort
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 13 Nov 2015 15:58:04 +0000 (16:58 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 13 Nov 2015 15:58:04 +0000 (16:58 +0100)
ivy.el

diff --git a/ivy.el b/ivy.el
index 3dbfd82c79eccbfa8d74efce1f98307eb2dbe777..7eb3898e86cbcaa1711e92f83033cf2c135af191 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1729,7 +1729,7 @@ The alist VAL is a sorting function with the signature of
 (defun ivy--sort-files-by-date (_name candidates)
   "Re-soft CANDIDATES according to file modification date."
   (let ((default-directory ivy--directory))
-    (cl-sort candidates
+    (cl-sort (copy-sequence candidates)
              (lambda (f1 f2)
                (time-less-p
                 (nth 5 (file-attributes f2))