diff --git a/jcs-modeline.el b/jcs-modeline.el index 5e10cf2..6ee398c 100644 --- a/jcs-modeline.el +++ b/jcs-modeline.el @@ -305,10 +305,15 @@ Position argument ARG0." :type 'boolean :group 'jcs-modeline) +(defun jcs-modeline--nerd-icons-icon-for-buffer () + "Return icon for buffer." + (or (ignore-errors (nerd-icons-icon-for-file (file-name-nondirectory (buffer-file-name)))) + (ignore-errors (nerd-icons-icon-for-mode major-mode)))) + (defun jcs-modeline--render-modes () "Render line modes." (let* ((icon (and jcs-modeline-show-mode-icons - (when-let* ((icon (nerd-icons-icon-for-buffer)) + (when-let* ((icon (jcs-modeline--nerd-icons-icon-for-buffer)) (icon (if (or (null icon) (symbolp icon)) (nerd-icons-faicon "nf-fa-file_o") icon))