diff options
| author | João Távora | 2023-02-27 11:04:44 +0000 |
|---|---|---|
| committer | João Távora | 2023-02-27 11:36:22 +0000 |
| commit | 647e40f4a0cf2c653d6ff6fc32116cbd2104d6ff (patch) | |
| tree | a25bb45657646b318158f28677f213d7b62748ef | |
| parent | 9d0f856a167040e66ad4bef5699e24552a6bc3c4 (diff) | |
| download | emacs-647e40f4a0cf2c653d6ff6fc32116cbd2104d6ff.tar.gz emacs-647e40f4a0cf2c653d6ff6fc32116cbd2104d6ff.zip | |
; And yet another fix to eglot-current-linepos-function's docstring
bug#61726
* lisp/progmodes/eglot.el (eglot-current-linepos-function):
Another fix.
| -rw-r--r-- | lisp/progmodes/eglot.el | 14 |
1 files 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 | |||
| 1453 | (defvar eglot-current-linepos-function #'eglot-utf-16-linepos | 1453 | (defvar eglot-current-linepos-function #'eglot-utf-16-linepos |
| 1454 | "Function calculating position relative to line beginning. | 1454 | "Function calculating position relative to line beginning. |
| 1455 | 1455 | ||
| 1456 | This is the inverse of `eglot-move-to-linepos-function' (which see). | 1456 | It is a function of no arguments considering the text from line |
| 1457 | It is a function of no arguments returning the number of code units | 1457 | beginning up to current point. The return value is the number of |
| 1458 | or bytes or codepoints corresponding to the current position of point, | 1458 | UTF code units needed to encode that text from the LSP server's |
| 1459 | relative to line beginning, as expected by the function that is the | 1459 | perspective. This may be a number of octets, 16-bit words or |
| 1460 | value of `eglot-move-to-linepos-function'.") | 1460 | Unicode code points, depending on whether the LSP server's |
| 1461 | `positionEncoding' capability is UTF-8, UTF-16 or UTF-32, | ||
| 1462 | respectively. Position of point should remain unaltered if that | ||
| 1463 | return value is fed through the corresponding inverse function | ||
| 1464 | `eglot-move-to-linepos-function' (which see).") | ||
| 1461 | 1465 | ||
| 1462 | (defun eglot-utf-8-linepos () | 1466 | (defun eglot-utf-8-linepos () |
| 1463 | "Calculate number of UTF-8 bytes from line beginning." | 1467 | "Calculate number of UTF-8 bytes from line beginning." |