Format codes.

This commit is contained in:
Vincent Zhang 2019-06-27 17:41:29 +08:00
parent 4befbbbdce
commit 24d30ccc1e
2 changed files with 30 additions and 44 deletions

View file

@ -79,7 +79,8 @@ Example: 'doom-modeline-env--ruby")
(add-hook 'find-file-hook #'doom-modeline-update-env) (add-hook 'find-file-hook #'doom-modeline-update-env)
(with-no-warnings (with-no-warnings
(if (boundp 'after-focus-change-function) (if (boundp 'after-focus-change-function)
(add-function :after after-focus-change-function (add-function
:after after-focus-change-function
(lambda () (lambda ()
(if (frame-focus-state) (if (frame-focus-state)
(doom-modeline-update-env)))) (doom-modeline-update-env))))

View file

@ -202,10 +202,8 @@ buffer where knowing the current project directory is important."
(concat (concat
(if active (if active
icon icon
(propertize icon 'face `(:inherit (propertize icon 'face `(:inherit ,(get-text-property 0 'face icon)
,(get-text-property 0 'face icon) :inherit mode-line-inactive)))
:inherit
mode-line-inactive)))
(doom-modeline-spc))) (doom-modeline-spc)))
(propertize (abbreviate-file-name default-directory) (propertize (abbreviate-file-name default-directory)
'face (if active 'face (if active
@ -358,7 +356,8 @@ mouse-1: Previous buffer\nmouse-3: Next buffer"
(with-no-warnings (with-no-warnings
(if (boundp 'after-focus-change-function) (if (boundp 'after-focus-change-function)
(add-function :after after-focus-change-function (add-function
:after after-focus-change-function
(lambda () (lambda ()
(when (frame-focus-state) (when (frame-focus-state)
(doom-modeline-update-buffer-file-name)))) (doom-modeline-update-buffer-file-name))))
@ -385,15 +384,11 @@ mouse-1: Previous buffer\nmouse-3: Next buffer"
(if (doom-modeline--active) (if (doom-modeline--active)
(if doom-modeline-major-mode-color-icon (if doom-modeline-major-mode-color-icon
icon icon
(propertize icon 'face `(:inherit (propertize icon 'face `(:inherit ,(let ((props (get-text-property 0 'face icon)))
,(let ((props (get-text-property 0 'face icon)))
props (remove :inherit props)) props (remove :inherit props))
:inherit :inherit mode-line)))
mode-line))) (propertize icon 'face `(:inherit ,(get-text-property 0 'face icon)
(propertize icon 'face `(:inherit :inherit mode-line-inactive)))
,(get-text-property 0 'face icon)
:inherit
mode-line-inactive)))
(doom-modeline-vspc)))))) (doom-modeline-vspc))))))
(defsubst doom-modeline--buffer-state-icon () (defsubst doom-modeline--buffer-state-icon ()
@ -404,10 +399,8 @@ mouse-1: Previous buffer\nmouse-3: Next buffer"
(concat (concat
(if (doom-modeline--active) (if (doom-modeline--active)
icon icon
(propertize icon 'face `(:inherit (propertize icon 'face `(:inherit ,(get-text-property 0 'face icon)
,(get-text-property 0 'face icon) :inherit mode-line-inactive)))
:inherit
mode-line-inactive)))
(doom-modeline-vspc))))) (doom-modeline-vspc)))))
(defsubst doom-modeline--buffer-name () (defsubst doom-modeline--buffer-name ()
@ -636,10 +629,8 @@ Uses `all-the-icons-octicon' to fetch the icon."
(doom-modeline-spc) (doom-modeline-spc)
(if active (if active
icon icon
(propertize icon 'face `(:inherit (propertize icon 'face `(:inherit ,(get-text-property 0 'face icon)
,(get-text-property 0 'face icon) :inherit mode-line-inactive)))
:inherit
mode-line-inactive)))
(if doom-modeline-icon (doom-modeline-vspc)) (if doom-modeline-icon (doom-modeline-vspc))
(if active (if active
text text
@ -964,10 +955,8 @@ mouse-1: List all problems%s"
(when icon (when icon
(if active (if active
icon icon
(propertize icon 'face `(:inherit (propertize icon 'face `(:inherit ,(get-text-property 0 'face icon)
,(get-text-property 0 'face icon) :inherit mode-line-inactive))))
:inherit
mode-line-inactive))))
(when (and doom-modeline-icon icon text) (when (and doom-modeline-icon icon text)
(doom-modeline-vspc)) (doom-modeline-vspc))
(when text (when text
@ -1732,10 +1721,8 @@ mouse-3: Reconnect to server" nick (eglot--major-mode server)))
(doom-modeline-spc) (doom-modeline-spc)
(if active (if active
icon icon
(propertize icon 'face `(:inherit (propertize icon 'face `(:inherit ,(get-text-property 0 'face icon)
,(get-text-property 0 'face icon) :inherit mode-line-inactive)))
:inherit
mode-line-inactive)))
(doom-modeline-spc)))))) (doom-modeline-spc))))))
(defun doom-modeline-override-eglot-modeline () (defun doom-modeline-override-eglot-modeline ()
@ -2115,8 +2102,7 @@ we don't want to remove that so we just return the original."
(doom-modeline-spc) (doom-modeline-spc)
(if percent-str (if percent-str
(concat (concat
(propertize icon 'face `(:inherit (propertize icon 'face `(:inherit ,(get-text-property 0 'face icon)
,(get-text-property 0 'face icon)
:inherit ,face) :inherit ,face)
'help-echo help-echo) 'help-echo help-echo)
(if doom-modeline-icon (doom-modeline-vspc)) (if doom-modeline-icon (doom-modeline-vspc))
@ -2170,8 +2156,7 @@ we don't want to remove that so we just return the original."
(if doom-modeline-major-mode-color-icon (if doom-modeline-major-mode-color-icon
props props
(remove :inherit props))) (remove :inherit props)))
:inherit :inherit mode-line-inactive))))))
mode-line-inactive))))))
(let ((info (format-mode-line 'mode-line-buffer-identification))) (let ((info (format-mode-line 'mode-line-buffer-identification)))
(if active (if active
info info