Properly remove stale Flymake diagnostics on :region reports
Among other bugs fixed, modifying a list structure while iterating it is a no-no. This would again cause duplicate diagnostics. See https://github.com/joaotavora/eglot/issues/223 for an example. * lisp/progmodes/flymake.el (Version): Bump to 1.0.5 (flymake--handle-report): Use cl-loop.
This commit is contained in:
parent
24695e8977
commit
459869a528
1 changed files with 8 additions and 9 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
;; Author: Pavel Kobyakov <pk_at_work@yahoo.com>
|
||||
;; Maintainer: João Távora <joaotavora@gmail.com>
|
||||
;; Version: 1.0.4
|
||||
;; Version: 1.0.5
|
||||
;; Package-Requires: ((emacs "26.1"))
|
||||
;; Keywords: c languages tools
|
||||
|
||||
|
@ -742,14 +742,13 @@ report applies to that region."
|
|||
;; the associated overlay.
|
||||
(cond
|
||||
(region
|
||||
(dolist (diag (flymake--backend-state-diags state))
|
||||
(let ((diag-beg (flymake--diag-beg diag))
|
||||
(diag-end (flymake--diag-beg diag)))
|
||||
(when (and (< diag-beg (cdr region))
|
||||
(> diag-end (car region)))
|
||||
(delete-overlay (flymake--diag-overlay diag))
|
||||
(setf (flymake--backend-state-diags state)
|
||||
(delq diag (flymake--backend-state-diags state)))))))
|
||||
(cl-loop for diag in (flymake--backend-state-diags state)
|
||||
if (or (> (flymake--diag-end diag) (car region))
|
||||
(< (flymake--diag-beg diag) (cdr region)))
|
||||
do (delete-overlay (flymake--diag-overlay diag))
|
||||
else collect diag into surviving
|
||||
finally (setf (flymake--backend-state-diags state)
|
||||
surviving)))
|
||||
(first-report
|
||||
(dolist (diag (flymake--backend-state-diags state))
|
||||
(delete-overlay (flymake--diag-overlay diag)))
|
||||
|
|
Loading…
Add table
Reference in a new issue