Closed dpassen closed 1 year ago
Does this do the trick?
diff --git a/flycheck-color-mode-line.el b/flycheck-color-mode-line.el
index 242fbdf..0a270f0 100644
--- a/flycheck-color-mode-line.el
+++ b/flycheck-color-mode-line.el
@@ -110,11 +110,11 @@ Used to restore the original mode line face.")
(let ((face (pcase status
(`finished
(cond
- ((flycheck-has-current-errors-p 'error)
+ ((flycheck-has-max-current-errors-p 'error)
'flycheck-color-mode-line-error-face)
- ((flycheck-has-current-errors-p 'warning)
+ ((flycheck-has-max-current-errors-p 'warning)
'flycheck-color-mode-line-warning-face)
- ((flycheck-has-current-errors-p 'info)
+ ((flycheck-has-max-current-errors-p 'info)
'flycheck-color-mode-line-info-face)
(t
'flycheck-color-mode-line-success-face)))
The way I'm reading the docstring ("Check if there is no current error more severe than LEVEL.") and looking at results, I think the order would have to go 'info -> 'warning -> 'error
.
Oh, quite right...
I don't use this package any more but if you suggest a revised snipped I can commit it.
I'll keep hacking at it. Thanks :-)
For the success case, might need to check for the current error list being empty, dunno.
Quite right
(cond
((not (flycheck-has-current-errors-p))
'flycheck-color-mode-line-success-face)
((flycheck-has-max-current-errors-p 'info)
'flycheck-color-mode-line-info-face)
((flycheck-has-max-current-errors-p 'warning)
'flycheck-color-mode-line-warning-face)
((flycheck-has-max-current-errors-p 'error)
'flycheck-color-mode-line-error-face)
(t
'flycheck-color-mode-line-success-face))
Can probably remove the t case. Want to test this some more.
Draft PR up. #6
Fixed by #6
lsp-mode is emitting flycheck errors, warnings, and info with levels like
lsp-flycheck-info-unnecessary
,lsp-flycheck-warning-unnecessary
, etc.These do not trigger these predicates. Is it possible to use
flycheck-error-level-compilation-level
to integrate them into this package?