]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el (ivy-switch-buffer): Don't fall back to switch-to-buffer
authorOleh Krehel <ohwoeowho@gmail.com>
Mon, 29 Feb 2016 07:57:52 +0000 (08:57 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Mon, 29 Feb 2016 07:57:52 +0000 (08:57 +0100)
Fixes #410

ivy.el

diff --git a/ivy.el b/ivy.el
index 5ebdb4a8b80e8c0eef87cae237d5cbe0506aab47..2ddcbb6b19efca3bad46a5a30f73d62c950e459d 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -2567,15 +2567,13 @@ Skip buffers that match `ivy-ignore-buffers'."
 (defun ivy-switch-buffer ()
   "Switch to another buffer."
   (interactive)
-  (if (not ivy-mode)
-      (call-interactively 'switch-to-buffer)
-    (let ((this-command 'ivy-switch-buffer))
-      (ivy-read "Switch to buffer: " 'internal-complete-buffer
-                :matcher #'ivy--switch-buffer-matcher
-                :preselect (buffer-name (other-buffer (current-buffer)))
-                :action #'ivy--switch-buffer-action
-                :keymap ivy-switch-buffer-map
-                :caller 'ivy-switch-buffer))))
+  (let ((this-command 'ivy-switch-buffer))
+    (ivy-read "Switch to buffer: " 'internal-complete-buffer
+              :matcher #'ivy--switch-buffer-matcher
+              :preselect (buffer-name (other-buffer (current-buffer)))
+              :action #'ivy--switch-buffer-action
+              :keymap ivy-switch-buffer-map
+              :caller 'ivy-switch-buffer)))
 
 ;;;###autoload
 (defun ivy-switch-buffer-other-window ()