branch: master
commit fcb4c7f62e2e28ee32cb6eca81169e8f7d799201
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el: Fix ivy-completing-read when def is a list
Fixes #1052
Re #1049
---
ivy.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/ivy.el b/ivy.el
index 15ae382..ce118d1 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1717,8 +1717,11 @@ This is useful for recursive `ivy-read'."
(t
(setq coll collection)))
(when def
- (unless (member def coll)
- (push def coll)))
+ (cond ((listp def)
+ (setq coll (cl-union def coll :test 'equal)))
+ ((member def coll))
+ (t
+ (push def coll))))
(when sort
(if (and (functionp collection)
(setq sort-fn (ivy--sort-function collection)))