summaryrefslogtreecommitdiff
path: root/eglot-x.el
diff options
context:
space:
mode:
authorFelicián Németh <felician.nemeth@gmail.com>2024-03-23 18:16:29 +0100
committerFelicián Németh <felician.nemeth@gmail.com>2024-03-23 18:16:29 +0100
commit5375c5127b1487384ad08f5b3483e6a70cbb3fa4 (patch)
treed14af46cb7c9b28447417798ad2bdacac514a72a /eglot-x.el
parent347bcfc81d935d9c93235e69a7ceb21950a728d4 (diff)
Fix off-by-one bug in displaying Runnables
* eglot-x.el: (xref-localtion-line/xref-loc-runnable): Convert LSP line number to Emacs line number.
Diffstat (limited to 'eglot-x.el')
-rw-r--r--eglot-x.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/eglot-x.el b/eglot-x.el
index 8f27665..8d58f35 100644
--- a/eglot-x.el
+++ b/eglot-x.el
@@ -1659,7 +1659,8 @@ Adapted from `eglot--lsp-xref-helper'."
(eglot--dbind ((Runnable) location)
(xref-loc-runnable-runnable l)
(eglot--dbind ((LocationLink) targetRange) location
- (plist-get (plist-get targetRange :start) :line))))
+ (when-let ((line (plist-get (plist-get targetRange :start) :line)))
+ (1+ line)))))
(cl-defmethod xref-location-marker ((l xref-loc-runnable))
(eglot--dbind ((Runnable) location args)