mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-27 19:19:53 +00:00
Improve: Construct icon via buffer name if no icon via major mode.
This commit is contained in:
parent
257fcd564b
commit
c13d5a3184
1 changed files with 7 additions and 0 deletions
|
@ -554,6 +554,11 @@ If DEFAULT is non-nil, set the default mode-line for all buffers."
|
||||||
(when doom-modeline-icon
|
(when doom-modeline-icon
|
||||||
(apply 'all-the-icons-icon-for-mode args)))
|
(apply 'all-the-icons-icon-for-mode args)))
|
||||||
|
|
||||||
|
(defun doom-modeline-icon-for-file (&rest args)
|
||||||
|
"Display icon for major mode via ARGS."
|
||||||
|
(when doom-modeline-icon
|
||||||
|
(apply 'all-the-icons-icon-for-file args)))
|
||||||
|
|
||||||
(defun doom-modeline--active ()
|
(defun doom-modeline--active ()
|
||||||
"Whether is an active window."
|
"Whether is an active window."
|
||||||
(eq (selected-window) doom-modeline-current-window))
|
(eq (selected-window) doom-modeline-current-window))
|
||||||
|
@ -743,6 +748,8 @@ buffer where knowing the current project directory is important."
|
||||||
"Update file icon in mode-line."
|
"Update file icon in mode-line."
|
||||||
(setq doom-modeline--buffer-file-icon
|
(setq doom-modeline--buffer-file-icon
|
||||||
(let ((icon (doom-modeline-icon-for-mode major-mode :height 0.92)))
|
(let ((icon (doom-modeline-icon-for-mode major-mode :height 0.92)))
|
||||||
|
(if (symbolp icon)
|
||||||
|
(setq icon (doom-modeline-icon-for-file (buffer-name) :height 0.92)))
|
||||||
(unless (symbolp icon)
|
(unless (symbolp icon)
|
||||||
(propertize icon
|
(propertize icon
|
||||||
'help-echo (format "Major-mode: `%s'" major-mode)
|
'help-echo (format "Major-mode: `%s'" major-mode)
|
||||||
|
|
Loading…
Reference in a new issue