emacs-diffs
[Top][All Lists]
Advanced

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

master 5b9b393c61: * lisp/progmodes/eglot.el (eglot--pos-to-lsp-position


From: Stephen Leake
Subject: master 5b9b393c61: * lisp/progmodes/eglot.el (eglot--pos-to-lsp-position): Improve comment
Date: Tue, 8 Nov 2022 12:45:43 -0500 (EST)

branch: master
commit 5b9b393c614f18f7cc2260436fbf99ed2a6d05ed
Author: Stephen Leake <stephen_leake@stephe-leake.org>
Commit: Stephen Leake <stephen_leake@stephe-leake.org>

    * lisp/progmodes/eglot.el (eglot--pos-to-lsp-position): Improve comment
---
 lisp/progmodes/eglot.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 204121045a..ce989b5611 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1426,7 +1426,8 @@ LBP defaults to `line-beginning-position'."
 (defun eglot--pos-to-lsp-position (&optional pos)
   "Convert point POS to LSP position."
   (eglot--widening
-   (list :line (1- (line-number-at-pos pos t)) ; F!@&#$CKING OFF-BY-ONE
+   ;; LSP line is zero-origin; emacs is one-origin.
+   (list :line (1- (line-number-at-pos pos t))
          :character (progn (when pos (goto-char pos))
                            (funcall eglot-current-column-function)))))
 



reply via email to

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