From: Stephen Leake Date: Tue, 8 Nov 2022 17:45:26 +0000 (-0800) Subject: * lisp/progmodes/eglot.el (eglot--pos-to-lsp-position): Improve comment X-Git-Tag: emacs-29.0.90~1616^2~240 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b9b393c614f18f7cc2260436fbf99ed2a6d05ed;p=emacs.git * lisp/progmodes/eglot.el (eglot--pos-to-lsp-position): Improve comment --- 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)))))