Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flycheck-error-level-interesting-p function #1994

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion flycheck.el
Original file line number Diff line number Diff line change
Expand Up @@ -4668,6 +4668,18 @@ level."
(push (cons level 1) counts-by-level))))
counts-by-level))

(defun flycheck-has-at-least-errors-p (errors level)
"Check if there are ERRORS at least as severe as LEVEL."
(let ((severity (flycheck-error-level-severity level)))
(seq-some (lambda (e) (>= (flycheck-error-level-severity
(flycheck-error-level e))
severity))
errors)))

(defun flycheck-has-at-least-current-errors-p (level)
"Check if there are current errors at least as severe as LEVEL."
(flycheck-has-at-least-errors-p flycheck-current-errors level))

(defun flycheck-has-max-errors-p (errors level)
"Check if there is no error in ERRORS more severe than LEVEL."
(let ((severity (flycheck-error-level-severity level)))
Expand Down Expand Up @@ -4880,7 +4892,7 @@ no errors as or more severe than `flycheck-navigation-minimum-level'."
(-if-let (min-level flycheck-navigation-minimum-level)
(or (<= (flycheck-error-level-severity min-level)
(flycheck-error-level-severity (flycheck-error-level err)))
(not (flycheck-has-current-errors-p min-level)))
(not (flycheck-has-at-least-current-errors-p min-level)))
t)))

(defun flycheck-next-error-pos (n &optional reset)
Expand Down