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

    ivy.el (ivy-switch-buffer): Preselect other-buffer
    
    * ivy.el (ivy-switch-buffer): Preselect other buffer, just like
      `switch-to-buffer' does it.
---
 ivy.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/ivy.el b/ivy.el
index 119f76c..1a92d0d 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1207,7 +1207,8 @@ When VIRTUAL is non-nil, add virtual buffers."
   (if (not ivy-mode)
       (call-interactively 'switch-to-buffer)
     (ivy-read "Switch to buffer: " 'internal-complete-buffer
-              :action #'ivy--switch-buffer-action)))
+              :action #'ivy--switch-buffer-action
+              :preselect (buffer-name (other-buffer (current-buffer))))))
 
 (provide 'ivy)
 

Reply via email to