diff options
author | Stephen Leake <stephen_leake@stephe-leake.org> | 2022-11-08 09:45:26 -0800 |
---|---|---|
committer | Stephen Leake <stephen_leake@stephe-leake.org> | 2022-11-08 09:45:26 -0800 |
commit | 5b9b393c614f18f7cc2260436fbf99ed2a6d05ed (patch) | |
tree | afcf112b6bf597b773a43ee6c203a5a8d305e6f1 | |
parent | 5fa0fcf18bb23f3a6f028a1478644b7027b02d8c (diff) | |
download | emacs-5b9b393c614f18f7cc2260436fbf99ed2a6d05ed.tar.gz |
* lisp/progmodes/eglot.el (eglot--pos-to-lsp-position): Improve comment
-rw-r--r-- | lisp/progmodes/eglot.el | 3 |
1 files changed, 2 insertions, 1 deletions
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))))) |