emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot 17e0ca4 047/139: Fix Flymake diagnostic positions


From: João Távora
Subject: [elpa] externals/eglot 17e0ca4 047/139: Fix Flymake diagnostic positions
Date: Mon, 14 May 2018 09:54:51 -0400 (EDT)

branch: externals/eglot
commit 17e0ca499e34638d5a52b4daf6b01e06fed3610c
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]