Fix diagnostics clearing in yaml-ts-mode-flymake

* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode-flymake): Call
the 'report-fn' callback outside the 'while' loop.  This change
ensures that Flymake receives an empty list of diagnostics and
clears old highlights when the YAML file has no linting errors.
(bug#81650)
This commit is contained in:
James Cherti 2026-08-18 08:43:26 -04:00 committed by Juri Linkov
parent cf1d8f9bc9
commit 9463931dc6

View file

@ -249,8 +249,8 @@ Calls REPORT-FN directly."
:error)))
(push (flymake-make-diagnostic
source beg end type msg)
diags))
(funcall report-fn diags))))
diags)))
(funcall report-fn diags)))
(flymake-log :warning "Canceling obsolete check %s" proc))
(kill-buffer (process-buffer proc)))))))
(process-send-region yaml-ts-mode--flymake-process (point-min) (point-max))