Merge pull request #1366 from flatwhatson/fix-ivy-rich
Fixes for ivy-switch-buffer icons
This commit is contained in:
commit
15e47cb9f1
2 changed files with 14 additions and 9 deletions
|
@ -34,14 +34,19 @@ Buffers that are considered unreal (see `doom-real-buffer-p') are dimmed with
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +ivy-rich-buffer-icon (candidate)
|
(defun +ivy-rich-buffer-icon (candidate)
|
||||||
"Display the icon for CANDIDATE buffer.
|
"Display the icon for CANDIDATE buffer."
|
||||||
|
;; NOTE This is inspired by `all-the-icons-ivy-buffer-transformer', minus the
|
||||||
Otherwise show the fundamental-mode icon."
|
;; buffer name and extra padding as those are handled by `ivy-rich'.
|
||||||
(with-current-buffer candidate
|
(propertize "\t" 'display
|
||||||
(let ((icon (all-the-icons-icon-for-mode major-mode)))
|
(if-let* ((buffer (get-buffer candidate))
|
||||||
(if (symbolp icon)
|
(mode (buffer-local-value 'major-mode buffer)))
|
||||||
(all-the-icons-icon-for-mode 'fundamental-mode)
|
(or
|
||||||
icon))))
|
(all-the-icons-ivy--icon-for-mode mode)
|
||||||
|
(all-the-icons-ivy--icon-for-mode (get mode 'derived-mode-parent))
|
||||||
|
(funcall
|
||||||
|
all-the-icons-ivy-family-fallback-for-buffer
|
||||||
|
all-the-icons-ivy-name-fallback-for-buffer))
|
||||||
|
(all-the-icons-icon-for-file candidate))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -88,7 +88,7 @@ immediately runs it on the current candidate (ending the ivy session)."
|
||||||
:after ivy
|
:after ivy
|
||||||
:config
|
:config
|
||||||
(when (featurep! +icons)
|
(when (featurep! +icons)
|
||||||
(cl-pushnew '(all-the-icons-ivy-icon-for-file (:width 2 :align right))
|
(cl-pushnew '(+ivy-rich-buffer-icon)
|
||||||
(cadr (plist-get ivy-rich-display-transformers-list
|
(cadr (plist-get ivy-rich-display-transformers-list
|
||||||
'ivy-switch-buffer))))
|
'ivy-switch-buffer))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue