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

    ivy.el (ivy-switch-buffer): Reset index to 0 on input
    
    Since the reset is on input, "C-x b RET" can still be used to cycle the
    last two buffers.
    
    Otherwise, the behavior seems intuitive enough.
    
    Fixes #522
    Fixes #513
---
 ivy.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ivy.el b/ivy.el
index 4a02fcd..11e764b 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2399,6 +2399,9 @@ Prefix matches to NAME are put ahead of the list."
                   (cl-position
                    (concat re-str "/") cands
                    :test #'equal))
+             (and (eq caller 'ivy-switch-buffer)
+                  (> (length name) 0)
+                  0)
              (and (not (string= name ""))
                   (not (and (require 'flx nil 'noerror)
                             (eq ivy--regex-function 'ivy--regex-fuzzy)

Reply via email to