Hi,

The byteidx() function returns the length of a string in bytes when
the specified character
index is equal to the number of characters in the string:

    echo byteidx("abc", 3)
    3

But the charidx() function returns -1 when the specified byte index is
equal to the number
of bytes in the string:

    echo charidx("abc", 3)
    -1

When I implemented the support for charidx() in 8.2.2233, I didn't
handle this case properly.
Should we change charidx() to return the number of characters in the
string in this case?
This will help in the LSP plugin where the language server specifies
the index after the
last character in some cases (e.g. completion).  The LSP plugin
currently checks for this
case and then uses strcharlen() to get the number of characters.  This
involves computing
the string length two times.

Thanks,
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/CAAW7x7n2wgCKdM5CoOkh4Grj_8yyPzVV1mxL1YY5FfnezPAqtA%40mail.gmail.com.

Raspunde prin e-mail lui