Skip to content

Commit

Permalink
ivy.el (ivy--reset-state): Fix for alists that require sorting
Browse files Browse the repository at this point in the history
Fixes #1687
  • Loading branch information
abo-abo committed Jul 31, 2018
1 parent 29cd688 commit 9386666
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions ivy.el
Expand Up @@ -1938,17 +1938,14 @@ This is useful for recursive `ivy-read'."
(dynamic-collection
(setq coll (funcall collection ivy-text)))
((and (consp collection) (listp (car collection)))
(if (and sort (setq sort-fn (ivy--sort-function caller)))
(progn
(setq sort nil)
(setq coll (mapcar #'car
(setf (ivy-state-collection ivy-last)
(sort (copy-sequence collection)
sort-fn)))))
(setq collection
(setf (ivy-state-collection ivy-last)
(cl-remove-if-not predicate collection)))
(setq coll (all-completions "" collection)))
(setq collection
(setf (ivy-state-collection ivy-last)
(if (and sort (setq sort-fn (ivy--sort-function caller)))
(progn
(setq sort nil)
(sort (copy-sequence collection) sort-fn))
(cl-remove-if-not predicate collection))))
(setq coll (all-completions "" collection))
(let ((i 0))
(ignore-errors
;; cm can be read-only
Expand Down

0 comments on commit 9386666

Please sign in to comment.