branch: master
commit 5c03c2bdbdb96aa0be1b607d061223be48d47e2d
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-read): Fix preselect logic
* ivy.el (ivy-read): Update.
Fixes e.g. `ert' passing "t" as the default, which isn't in collection,
but `all-completions' doesn't return nil.
---
ivy.el | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ivy.el b/ivy.el
index 7311077..a679f74 100644
--- a/ivy.el
+++ b/ivy.el
@@ -480,7 +480,7 @@ When SORT is t, refer to `ivy-sort-functions-alist' for
sorting."
(setq coll (cl-sort (copy-sequence coll) sort-fn)))))
(when preselect
(unless (or require-match
- (all-completions preselect collection))
+ (member preselect coll))
(setq coll (cons preselect coll))))
(setq ivy--index (or
(and preselect