From 7b11f67c7642b46a2ac67aebee2a5133a74c64ef Mon Sep 17 00:00:00 2001 From: Stefan Lendl Date: Tue, 1 Dec 2020 16:14:49 +0100 Subject: [PATCH] counsel-bookmark use filename only if available fixes #4344 --- modules/completion/ivy/config.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index 676a431b7..806ede1ef 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -118,6 +118,10 @@ evil-ex-specific constructs, so we disable it solely in evil-ex." 'ivy-switch-buffer)) :test #'equal)) + (defun ivy-rich-bookmark-filename-or-empty (candidate) + (let ((filename (ivy-rich-bookmark-filename candidate))) + (if (not filename) "" filename))) + ;; Enahnce the appearance of a couple counsel commands (plist-put! ivy-rich-display-transformers-list 'counsel-describe-variable @@ -135,7 +139,7 @@ evil-ex-specific constructs, so we disable it solely in evil-ex." 'counsel-bookmark '(:columns ((ivy-rich-candidate (:width 0.5)) - (ivy-rich-bookmark-filename (:width 60))))) + (ivy-rich-bookmark-filename-or-empty (:width 60))))) ;; Remove built-in coloring of buffer list; we do our own (setq ivy-switch-buffer-faces-alist nil)