Commit 2a2a1bdb authored by João Távora's avatar João Távora

Protect Flymake from being corrupted by backends

A backend building a diagnostic with a nil :type would cause Flymake
to create a diagnostic without an overlay, confusing Flymake's
accounting of overlays and diagnostics

* lisp/progmodes/flymake.el (flymake--highlight-line): Return
non-nil unconditionally.
parent 1bf5be5d
......@@ -604,10 +604,11 @@ associated `flymake-category' return DEFAULT."
(defun flymake--highlight-line (diagnostic)
"Highlight buffer with info in DIGNOSTIC."
(when-let* ((type (flymake--diag-type diagnostic))
(ov (make-overlay
(flymake--diag-beg diagnostic)
(flymake--diag-end diagnostic))))
(let ((type (or (flymake--diag-type diagnostic)
(ov (make-overlay
(flymake--diag-beg diagnostic)
(flymake--diag-end diagnostic))))
;; First set `category' in the overlay
(overlay-put ov 'category
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment