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

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

[elpa] 1.2 f4f93d3 014/101: Fix placement of diagnostics with same start


From: Christian Johansson
Subject: [elpa] 1.2 f4f93d3 014/101: Fix placement of diagnostics with same start and end positions
Date: Thu, 29 Apr 2021 15:08:51 -0400 (EDT)

tag: 1.2
commit f4f93d3006f67de1bca9935d55872924c0f4b86b
Author: mkcms <k.michal@zoho.com>
Commit: João Távora <joaotavora@gmail.com>

    Fix placement of diagnostics with same start and end positions
    
    Some servers such as cquery and clangd publish diagnostic with
    identical start and end positions.
    
    * eglot.el (eglot-handle-notification
      :textDocument/publishDiagnostics): Add 1 to :line since LSP lines
      are 0-based.  Don't subtract 1 from :character, since both emacs and
      LSP have 0-based columns.
---
 eglot.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eglot.el b/eglot.el
index 0bb162b..58efc16 100644
--- a/eglot.el
+++ b/eglot.el
@@ -929,8 +929,8 @@ Uses THING, FACE, DEFS and PREPEND."
                          (let* ((st (plist-get range :start))
                                 (diag-region
                                  (flymake-diag-region
-                                  (current-buffer) (plist-get st :line)
-                                  (1- (plist-get st :character)))))
+                                  (current-buffer) (1+ (plist-get st :line))
+                                  (plist-get st :character))))
                            (setq beg (car diag-region)
                                  end (cdr diag-region))))
                      (eglot--make-diag (current-buffer) beg end



reply via email to

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