Skip to content

Commit

Permalink
improve check icons
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangou committed Mar 22, 2024
1 parent b68fe0a commit 3f1d33a
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions doom-modeline-segments.el
Original file line number Diff line number Diff line change
Expand Up @@ -755,32 +755,26 @@ Uses `nerd-icons-mdicon' to fetch the icon."
"Displays the check TEXT with FACE."
(propertize text 'face (or face 'mode-line)))

(defcustom doom-modeline-check-error-icon
(defvar doom-modeline-check-error-icon
(doom-modeline-check-icon
"nf-md-alert_circle_outline" "" "!" 'doom-modeline-urgent)
"Icon to be using in check segment.
Only works if `doom-modeline-check-simple-format' is set to the symbol
`icons'."
:type '(string)
:group 'doom-modeline)
`icons'.")

(defcustom doom-modeline-check-warning-icon
(defvar doom-modeline-check-warning-icon
(doom-modeline-check-icon
"nf-md-alert_outline" "" "!" 'doom-modeline-warning)
"Icon to be using in check segment.
Only works if `doom-modeline-check-simple-format' is set to the symbol
`icons'."
:type '(string)
:group 'doom-modeline)
`icons'.")

(defcustom doom-modeline-check-note-icon
(defvar doom-modeline-check-note-icon
(doom-modeline-check-icon
"nf-md-information_outline" "" "i" 'doom-modeline-info)
"Icon to be using in check segment.
Only works if `doom-modeline-check-simple-format' is set to the symbol
`icons'."
:type '(string)
:group 'doom-modeline)
`icons'.")

;; Flycheck

Expand Down Expand Up @@ -889,6 +883,7 @@ mouse-2: Show help for minor mode")
(doom-modeline-check-text (number-to-string .info)
'doom-modeline-info)))
('icons (format "%s %s %s %s %s"
doom-modeline-check-error- icon
(doom-modeline-check-text (number-to-string .error)
'doom-modeline-urgent)
doom-modeline-check-warning-icon
Expand Down Expand Up @@ -1092,6 +1087,7 @@ mouse-2: Show help for minor mode"
(doom-modeline-check-text (number-to-string .note)
'doom-modeline-info)))
('icons (format "%s %s %s %s %s"
doom-modeline-check-error-icon
(doom-modeline-check-text (number-to-string .error)
'doom-modeline-urgent)
doom-modeline-check-warning-icon
Expand Down Expand Up @@ -1139,6 +1135,7 @@ mouse-1: List all problems%s"
(dolist (buf (buffer-list))
(with-current-buffer buf
(when (bound-and-true-p flymake-mode)
(doom-modeline-update-flymake-icon)
(doom-modeline-update-flymake-text)))))))

(doom-modeline-def-segment check
Expand All @@ -1150,7 +1147,7 @@ mouse-1: List all problems%s"
((and (bound-and-true-p flycheck-mode)
(bound-and-true-p flycheck--automatically-enabled-checkers))
`(,doom-modeline--flycheck-icon . ,doom-modeline--flycheck-text))))
(icon (car seg))
(icon (and (eq doom-modeline-check-simple-format t) (car seg)))
(text (cdr seg)))
(concat
(and (or icon text) (doom-modeline-spc))
Expand Down

0 comments on commit 3f1d33a

Please sign in to comment.