Refactor.

This commit is contained in:
Vincent Zhang 2019-05-21 14:40:35 +08:00
parent 825c2bed71
commit 58c05c5834

View file

@ -942,15 +942,14 @@ mouse-1: List all problems%s"
(advice-add #'flymake--handle-report :after #'doom-modeline-update-flymake-text)
(doom-modeline-def-segment checker
"Displays color-coded error status in the current buffer with pretty
icons."
"Displays color-coded error status in the current buffer with pretty icons."
(let ((active (doom-modeline--active))
(seg (cond ((and (bound-and-true-p flymake-mode)
(bound-and-true-p flymake--backend-state)) ; only support 26+
`(,doom-modeline--flymake-icon . ,doom-modeline--flymake-text))
((bound-and-true-p flycheck-mode)
`(,doom-modeline--flycheck-icon . ,doom-modeline--flycheck-text)))))
(when seg
(if seg
(let ((icon (car seg))
(text (cdr seg)))
(concat
@ -967,7 +966,8 @@ icons."
(when text
(if active
text
(propertize text 'face 'mode-line-inactive))))))))
(propertize text 'face 'mode-line-inactive)))))
"")))
;;