counsel-bookmark use filename only if available

fixes #4344
This commit is contained in:
Stefan Lendl 2020-12-01 16:14:49 +01:00
parent 7038c2e800
commit 7b11f67c76

View file

@ -118,6 +118,10 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
'ivy-switch-buffer)) 'ivy-switch-buffer))
:test #'equal)) :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 ;; Enahnce the appearance of a couple counsel commands
(plist-put! ivy-rich-display-transformers-list (plist-put! ivy-rich-display-transformers-list
'counsel-describe-variable 'counsel-describe-variable
@ -135,7 +139,7 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
'counsel-bookmark 'counsel-bookmark
'(:columns '(:columns
((ivy-rich-candidate (:width 0.5)) ((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 ;; Remove built-in coloring of buffer list; we do our own
(setq ivy-switch-buffer-faces-alist nil) (setq ivy-switch-buffer-faces-alist nil)