branch: externals/consult
commit 5b2b7d39534314c53e95958c3d9daeee40329c28
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    consult-flymake: Filter diagnostics pointing to non-existing buffer (Fix 
#716)
---
 consult-flymake.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/consult-flymake.el b/consult-flymake.el
index 86724fc194..26274adecd 100644
--- a/consult-flymake.el
+++ b/consult-flymake.el
@@ -56,7 +56,9 @@ DIAGS should be a list of diagnostics as returned from 
`flymake-diagnostics'."
                               ('flymake-error ?e)
                               ('flymake-warning ?w)
                               (_ ?n))))))))
-           diags))
+           (seq-filter (lambda (diag)
+                         (buffer-live-p (flymake-diagnostic-buffer diag)))
+                       diags)))
          (buffer-width (apply #'max (mapcar (lambda (x) (length (nth 0 x))) 
diags)))
          (line-width (apply #'max (mapcar (lambda (x) (length 
(number-to-string (nth 1 x)))) diags)))
          (fmt (format "%%-%ds %%-%dd %%-7s %%s" buffer-width line-width)))

Reply via email to