1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 11:50:51 -08:00

* lisp/progmodes/eglot.el (eglot--pos-to-lsp-position): Improve comment

This commit is contained in:
Stephen Leake 2022-11-08 09:45:26 -08:00
parent 5fa0fcf18b
commit 5b9b393c61

View file

@ -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)))))