From af1d46bdc23777c0f59569b6066156a989d7c1c1 Mon Sep 17 00:00:00 2001 From: Anil Wadghule Date: Tue, 21 Feb 2023 20:50:44 +0530 Subject: [PATCH] Apply counsel-switch-buffer patch from here https://github.com/Yevgnen/ivy-rich/issues/115 --- anil/anil-counsel.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/anil/anil-counsel.el b/anil/anil-counsel.el index c78981f..d8815a4 100644 --- a/anil/anil-counsel.el +++ b/anil/anil-counsel.el @@ -20,6 +20,11 @@ ("d" (lambda (file) (setq recentf-list (delete file recentf-list))) "delete from recentf"))) + (defun ivy-rich--switch-buffer-directory! (orig-fun &rest args) + (cl-letf (((symbol-function 'directory-file-name) #'file-name-directory)) + (apply orig-fun args))) + (advice-add 'ivy-rich--switch-buffer-directory :around #'ivy-rich--switch-buffer-directory!) + (defun anil/counsel-buffer-or-recentf-candidates () "Return candidates for `counsel-buffer-or-recentf'." (require 'recentf) @@ -41,7 +46,7 @@ :bind ("M-x" . counsel-M-x) ("C-x C-f" . counsel-find-file) ("C-x C-r" . counsel-recentf) - ("C-x b" . counsel-projectile-switch-to-buffer) + ("C-x b" . counsel-switch-buffer) ("C-M-o" . counsel-imenu) )