emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ivy-hydra 3ecf828 344/395: ivy.el (ivy-switch-buffer):


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 3ecf828 344/395: ivy.el (ivy-switch-buffer): Don't lose the current index
Date: Thu, 25 Feb 2021 08:32:35 -0500 (EST)

branch: externals/ivy-hydra
commit 3ecf8281c1612eab4204976926ef1ae950bc331d
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ivy.el (ivy-switch-buffer): Don't lose the current index
    
    When e.g. candidate number 1 is selected, on more input that matches
    this candidate, keep it selected, instead of selecting candidate 0 as
    before.
    
    Fixes #1500
    Fixes #2648
---
 ivy.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ivy.el b/ivy.el
index 26e20ae..556a227 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3676,8 +3676,9 @@ CANDS are the current candidates."
                                         cands
                                         :test #'ivy--case-fold-string=)))
                      ((and (eq caller 'ivy-switch-buffer)
-                           (not empty)
-                           0))
+                           (not empty))
+                      (or (cl-position current cands :test #'string=)
+                          0))
                      ((and (not empty)
                            (not (eq caller 'swiper))
                            (not (and ivy--flx-featurep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]