branch: externals/elpa commit 17e0ca499e34638d5a52b4daf6b01e06fed3610c Author: João Távora <joaotav...@gmail.com> Commit: João Távora <joaotav...@gmail.com>
Fix Flymake diagnostic positions It's better not to use flymake-diag-region here. * eglot.el (eglot--textDocument/publishDiagnostics): Calculate position by hand. --- eglot.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/eglot.el b/eglot.el index 86c0a4c..bb0427a 100644 --- a/eglot.el +++ b/eglot.el @@ -637,10 +637,13 @@ running. INTERACTIVE is t if called interactively." (with-current-buffer buffer (cl-flet ((pos-at (pos-plist) - (car (flymake-diag-region - (current-buffer) - (plist-get pos-plist :line) - (plist-get pos-plist :character))))) + (save-excursion + (goto-char (point-min)) + (forward-line (plist-get pos-plist :line)) + (forward-char + (min (plist-get pos-plist :character) + (- (line-end-position) + (line-beginning-position))))))) (cl-loop for diag-spec across diagnostics collect (cl-destructuring-bind (&key range severity _code _source message)