branch: master
commit 49321c022d4aa3c9fb17f783ab2ee6f02462e4de
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
Allow duplicate candidates in `ivy-read'
* ivy.el (ivy-completions): Use `eq' instead of `equal' in
`cl-position'.
---
ivy.el | 6 +++---
swiper.el | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ivy.el b/ivy.el
index 3e22968..2b7af6a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -393,9 +393,9 @@ CANDIDATES is a list of strings."
idx)
(setq ivy--length (length cands))
(when (and tail ivy--old-cands)
- (while (and tail
- (null (setq idx (cl-position (pop tail) cands
- :test #'equal)))))
+ (while (and tail (null idx))
+ ;; Compare with eq to handle equal duplicates in cands
+ (setq idx (cl-position (pop tail) cands)))
(setq ivy--index (or idx 0)))
(setq ivy--old-cands cands)
(when (>= ivy--index ivy--length)
diff --git a/swiper.el b/swiper.el
index 7a418c9..8a5e811 100644
--- a/swiper.el
+++ b/swiper.el
@@ -137,7 +137,7 @@
(line-beginning-position)
(line-end-position)))
candidates)
- (zerop (forward-line 1)))
+ (forward-line 1))
(nreverse candidates))))))
(defvar swiper--opoint 1