branch: master
commit 03f90afa25c2efb0cacefa15838a6ddf8185cd67
Author: Basil L. Contovounesios <[email protected]>
Commit: Basil L. Contovounesios <[email protected]>
ivy.el (ivy-rotate-sort): Guard against nil sort
Do not attempt to rotate sorting functions if they are nil, as this
will result in a list of sorting functions equal to '(nil).
---
ivy.el | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/ivy.el b/ivy.el
index ea5ce92..a4f9652 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1308,10 +1308,9 @@ This only has an effect if multiple sorting functions are
specified for the current collection in
`ivy-sort-functions-alist'."
(interactive)
- (let ((cell
- (assoc (ivy-state-collection ivy-last) ivy-sort-functions-alist)))
- (when (listp (cdr cell))
- (setcdr cell (append (cddr cell) (list (cadr cell))))
+ (let ((cell (assoc (ivy-state-collection ivy-last)
ivy-sort-functions-alist)))
+ (when (consp (cdr cell))
+ (setcdr cell `(,@(cddr cell) ,(cadr cell)))
(ivy--reset-state ivy-last))))
(defvar ivy-index-functions-alist