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.
This commit is contained in:
João Távora
2019-03-29 12:27:11 +00:00
parent 1bf5be5d37
commit 2a2a1bdb8f

View File

@@ -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)
:error))
(ov (make-overlay
(flymake--diag-beg diagnostic)
(flymake--diag-end diagnostic))))
;; First set `category' in the overlay
;;
(overlay-put ov 'category