From 5b9b393c614f18f7cc2260436fbf99ed2a6d05ed Mon Sep 17 00:00:00 2001 From: Stephen Leake Date: Tue, 8 Nov 2022 09:45:26 -0800 Subject: [PATCH] * 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 204121045a0..ce989b56117 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))))) -- 2.39.2