Refactor.

This commit is contained in:
Vincent Zhang 2019-02-18 01:44:16 +08:00
parent 57f1a98e58
commit 11481cc647

View file

@ -766,9 +766,10 @@ mouse-2: Show help for minor mode"
(some-waiting "Running..." "") (some-waiting "Running..." "")
((null known) (doom-modeline-checker-text "-" 'font-lock-doc-face)) ((null known) (doom-modeline-checker-text "-" 'font-lock-doc-face))
(all-disabled (doom-modeline-checker-text "-" 'doom-modeline-urgent)) (all-disabled (doom-modeline-checker-text "-" 'doom-modeline-urgent))
(t (when (> (+ .error .warning .note) 0) (t (let ((num (+ .error .warning .note)))
(when (> num 0)
(if doom-modeline-checker-simple-format (if doom-modeline-checker-simple-format
(doom-modeline-checker-text (number-to-string (+ .error .warning .note)) (doom-modeline-checker-text (number-to-string num)
(cond ((> .error 0) 'doom-modeline-urgent) (cond ((> .error 0) 'doom-modeline-urgent)
((> .warning 0) 'doom-modeline-warning) ((> .warning 0) 'doom-modeline-warning)
(t 'doom-modeline-info))) (t 'doom-modeline-info)))
@ -778,7 +779,7 @@ mouse-2: Show help for minor mode"
(doom-modeline-checker-text (number-to-string .warning) (doom-modeline-checker-text (number-to-string .warning)
'doom-modeline-warning) 'doom-modeline-warning)
(doom-modeline-checker-text (number-to-string .note) (doom-modeline-checker-text (number-to-string .note)
'doom-modeline-info)))))))) 'doom-modeline-info)))))))))
(propertize (propertize
text text
'help-echo (cond 'help-echo (cond