summary refs log tree commit diff stats
path: root/tag-emacs/emacs.d
diff options
context:
space:
mode:
Diffstat (limited to 'tag-emacs/emacs.d')
-rw-r--r--tag-emacs/emacs.d/init.org13
1 files changed, 8 insertions, 5 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index 8eae533..32fa196 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -1209,11 +1209,14 @@ replace helm and ido.
     :config (progn
               (defun counsel-switch-to-projectile-buffer (arg)
                 "Forward to `projectile-switch-to-buffer'."
-                (ivy-read (format "Switch to buffer [%s]: " (projectile-project-name))
-                          (projectile-project-buffer-names)
-                          :preselect (buffer-name (other-buffer (current-buffer)))
-                          :action #'ivy--switch-buffer-action
-                          :keymap ivy-switch-buffer-map))))
+                (interactive "P")
+                (if (projectile-project-p)
+                    (ivy-read (format "Switch to buffer [%s]: " (projectile-project-name))
+                              (projectile-project-buffer-names)
+                              :preselect (buffer-name (other-buffer (current-buffer)))
+                              :action #'ivy--switch-buffer-action
+                              :keymap ivy-switch-buffer-map)
+                  (call-interactively #'ivy-switch-buffer)))))
 #+END_SRC