branch: master
commit 039353df6b7021c8f568dc55dafe4e1fb8bf3807
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    ivy.el (ivy--preselect-index): Fix ivy-resume for swiper-isearch
    
    Fixes #2153
---
 ivy.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ivy.el b/ivy.el
index 8ee5f26..58af21a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2485,7 +2485,9 @@ Minibuffer bindings:
 (defun ivy--preselect-index (preselect candidates)
   "Return the index of PRESELECT in CANDIDATES."
   (cond ((integerp preselect)
-         preselect)
+         (if (integerp (car candidates))
+             (cl-position preselect candidates)
+           preselect))
         ((cl-position preselect candidates :test #'equal))
         ((ivy--regex-p preselect)
          (cl-position preselect candidates :test #'string-match-p))))

Reply via email to