mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 19:19:50 +00:00
Refactor.
This commit is contained in:
parent
825c2bed71
commit
58c05c5834
1 changed files with 20 additions and 20 deletions
|
@ -942,32 +942,32 @@ mouse-1: List all problems%s"
|
||||||
(advice-add #'flymake--handle-report :after #'doom-modeline-update-flymake-text)
|
(advice-add #'flymake--handle-report :after #'doom-modeline-update-flymake-text)
|
||||||
|
|
||||||
(doom-modeline-def-segment checker
|
(doom-modeline-def-segment checker
|
||||||
"Displays color-coded error status in the current buffer with pretty
|
"Displays color-coded error status in the current buffer with pretty icons."
|
||||||
icons."
|
|
||||||
(let ((active (doom-modeline--active))
|
(let ((active (doom-modeline--active))
|
||||||
(seg (cond ((and (bound-and-true-p flymake-mode)
|
(seg (cond ((and (bound-and-true-p flymake-mode)
|
||||||
(bound-and-true-p flymake--backend-state)) ; only support 26+
|
(bound-and-true-p flymake--backend-state)) ; only support 26+
|
||||||
`(,doom-modeline--flymake-icon . ,doom-modeline--flymake-text))
|
`(,doom-modeline--flymake-icon . ,doom-modeline--flymake-text))
|
||||||
((bound-and-true-p flycheck-mode)
|
((bound-and-true-p flycheck-mode)
|
||||||
`(,doom-modeline--flycheck-icon . ,doom-modeline--flycheck-text)))))
|
`(,doom-modeline--flycheck-icon . ,doom-modeline--flycheck-text)))))
|
||||||
(when seg
|
(if seg
|
||||||
(let ((icon (car seg))
|
(let ((icon (car seg))
|
||||||
(text (cdr seg)))
|
(text (cdr seg)))
|
||||||
(concat
|
(concat
|
||||||
(doom-modeline-whitespace)
|
(doom-modeline-whitespace)
|
||||||
(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
|
:inherit
|
||||||
mode-line-inactive))))
|
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
|
||||||
(if active
|
(if active
|
||||||
text
|
text
|
||||||
(propertize text 'face 'mode-line-inactive))))))))
|
(propertize text 'face 'mode-line-inactive)))))
|
||||||
|
"")))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue