Add an icon for helm buffers.

This commit is contained in:
Vincent Zhang 2019-05-10 14:06:37 +08:00
parent 09bbe95a07
commit 958756996a
3 changed files with 10 additions and 4 deletions

View file

@ -96,10 +96,10 @@ The `doom-modeline` was designed for minimalism, and offers:
![package](https://user-images.githubusercontent.com/140797/57503916-e769d380-7324-11e9-906d-44c79f7408a3.png ![package](https://user-images.githubusercontent.com/140797/57503916-e769d380-7324-11e9-906d-44c79f7408a3.png
"Package") "Package")
![info](https://user-images.githubusercontent.com/140797/57504082-9d352200-7325-11e9-94e4-9f89e1f63190.png ![info](https://user-images.githubusercontent.com/140797/57506248-d96c8080-732d-11e9-8167-644c8fc4e0db.png
"Info") "Info")
![helm](https://user-images.githubusercontent.com/140797/57504021-5515ff80-7325-11e9-92b4-5c0213fa1ba3.png ![helm](https://user-images.githubusercontent.com/140797/57506112-6531dd00-732d-11e9-8a5e-22166f42dd4c.png
"Helm") "Helm")
## Install ## Install

View file

@ -491,6 +491,11 @@ Given ~/Projects/FOSS/emacs/lisp/comint.el
(when doom-modeline-icon (when doom-modeline-icon
(apply #'all-the-icons-alltheicon args))) (apply #'all-the-icons-alltheicon args)))
(defun doom-modeline-icon-fileicon (&rest args)
"Display fileicon via ARGS."
(when doom-modeline-icon
(apply #'all-the-icons-fileicon args)))
(defun doom-modeline-icon-for-mode (&rest args) (defun doom-modeline-icon-for-mode (&rest args)
"Display icon for major mode via ARGS." "Display icon for major mode via ARGS."
(when doom-modeline-icon (when doom-modeline-icon

View file

@ -201,7 +201,7 @@ buffer where knowing the current project directory is important."
:face face :face face
:v-adjust -0.05 :v-adjust -0.05
:height 1.25) :height 1.25)
(if (display-graphic-p) " ") (if doom-modeline-icon " ")
(propertize (abbreviate-file-name default-directory) 'face face)))) (propertize (abbreviate-file-name default-directory) 'face face))))
;; ;;
@ -2136,6 +2136,8 @@ The cdr can also be a function that returns a name to use.")
(when (bound-and-true-p helm-alive-p) (when (bound-and-true-p helm-alive-p)
(concat (concat
" " " "
(doom-modeline-icon-fileicon "elisp" :height 1.0 :v-adjust -0.1 :face 'all-the-icons-dpurple)
(if doom-modeline-icon " ")
(propertize (propertize
(let ((custom (cdr (assoc (buffer-name) doom-modeline--helm-buffer-ids))) (let ((custom (cdr (assoc (buffer-name) doom-modeline--helm-buffer-ids)))
(case-fold-search t) (case-fold-search t)
@ -2187,7 +2189,6 @@ The cdr can also be a function that returns a name to use.")
(eq 1 (cdr (assq 'follow doom-modeline--helm-current-source)))) (eq 1 (cdr (assq 'follow doom-modeline--helm-current-source))))
"HF")) "HF"))
(provide 'doom-modeline-segments) (provide 'doom-modeline-segments)
;;; doom-modeline-segments.el ends here ;;; doom-modeline-segments.el ends here