Hi, On Tue, Jun 20, 2023 at 2:08 PM Yee Cheng Chin <[email protected]> wrote:
> I guess this is to make it so that you can do something like > byteidx(charidx(…)) and vice versa and have it return itself? And you are > essentially using charidx double duty as a fictional strcharlen() > function (since strlen() returns bytes and we don't have a function to > return number of Unicode characters in a string)? > > > A LSP server can encode a position offset using UTF-8 or UTF-16 or UTF-32 encoding as described here: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocuments . A Vim LSP plugin needs to decode and encode the character position in a file to the corresponding encoding supported by the LSP server. For example, see the functions in the following file: https://github.com/yegappan/lsp/blob/main/autoload/lsp/offset.vim This PR helps in simplifying some of the code in the above functions. Regards, Yegappan -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAAW7x7%3DF0jeH_3QeT-kfDNz%3DAbY%2B7iKf7JPdgObs9jfYCK8Mzg%40mail.gmail.com.
