emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 647e40f4a0c 1/2: ; And yet another fix to eglot-current-linepos


From: João Távora
Subject: emacs-29 647e40f4a0c 1/2: ; And yet another fix to eglot-current-linepos-function's docstring
Date: Mon, 27 Feb 2023 06:34:57 -0500 (EST)

branch: emacs-29
commit 647e40f4a0cf2c653d6ff6fc32116cbd2104d6ff
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    ; And yet another fix to eglot-current-linepos-function's docstring
    
    bug#61726
    
    * lisp/progmodes/eglot.el (eglot-current-linepos-function):
    Another fix.
---
 lisp/progmodes/eglot.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index dd84f545ed4..32f78f89c0a 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1453,11 +1453,15 @@ CONNECT-ARGS are passed as additional arguments to
 (defvar eglot-current-linepos-function #'eglot-utf-16-linepos
   "Function calculating position relative to line beginning.
 
-This is the inverse of `eglot-move-to-linepos-function' (which see).
-It is a function of no arguments returning the number of code units
-or bytes or codepoints corresponding to the current position of point,
-relative to line beginning, as expected by the function that is the
-value of `eglot-move-to-linepos-function'.")
+It is a function of no arguments considering the text from line
+beginning up to current point.  The return value is the number of
+UTF code units needed to encode that text from the LSP server's
+perspective.  This may be a number of octets, 16-bit words or
+Unicode code points, depending on whether the LSP server's
+`positionEncoding' capability is UTF-8, UTF-16 or UTF-32,
+respectively.  Position of point should remain unaltered if that
+return value is fed through the corresponding inverse function
+`eglot-move-to-linepos-function' (which see).")
 
 (defun eglot-utf-8-linepos ()
   "Calculate number of UTF-8 bytes from line beginning."



reply via email to

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