ui/doom-modeline: optimize flycheck segment
This commit is contained in:
parent
a6d8a0b4ec
commit
630188e27e
1 changed files with 3 additions and 2 deletions
|
@ -427,7 +427,8 @@ directory, the file name, and its state (modified, read-only or non-existent)."
|
||||||
|
|
||||||
(defvar-local +doom-modeline--flycheck nil)
|
(defvar-local +doom-modeline--flycheck nil)
|
||||||
(add-hook 'flycheck-status-changed-functions #'+doom-modeline|update-flycheck-segment)
|
(add-hook 'flycheck-status-changed-functions #'+doom-modeline|update-flycheck-segment)
|
||||||
(defun +doom-modeline|update-flycheck-segment (status)
|
(add-hook 'flycheck-mode-hook #'+doom-modeline|update-flycheck-segment)
|
||||||
|
(defun +doom-modeline|update-flycheck-segment (&optional status)
|
||||||
(setq +doom-modeline--flycheck
|
(setq +doom-modeline--flycheck
|
||||||
(pcase status
|
(pcase status
|
||||||
('finished (if flycheck-current-errors
|
('finished (if flycheck-current-errors
|
||||||
|
@ -446,7 +447,7 @@ directory, the file name, and its state (modified, read-only or non-existent)."
|
||||||
(def-modeline-segment! flycheck
|
(def-modeline-segment! flycheck
|
||||||
"Displays color-coded flycheck error status in the current buffer with pretty
|
"Displays color-coded flycheck error status in the current buffer with pretty
|
||||||
icons."
|
icons."
|
||||||
(if (bound-and-true-p flycheck-mode) +doom-modeline--flycheck))
|
+doom-modeline--flycheck)
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue