Hi all,

The language server protocol messages use character column number whereas many
of the built-in Vim functions (e.g. matchaddpos()) deal with byte column number.

Several built-in functions were added to convert between the character and byte
column numbers (byteidx(), charcol(), charidx(), getcharpos(),
getcursorcharpos(), etc,).
But these functions deal with strings, current cursor position or the
position of a mark.

We currently don't have a function to return the byte number given the character
number in a line in a buffer.  The workaround is to use getbufline()
to get the entire
buffer line and then use byteidx() to get the byte number from the
character number.

I am thinking of introducing a new function named charcol2bytecol() that accepts
a buffer number, line number and the character number in the line and
returns the
corresponding byte number.  Any suggestions/comments on this?

We should also modify the matchaddpos() function to accept character numbers
in a line in addition to the byte numbers.

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%3DRz5kuO9h9Y9ksx7EbHOyLmWh%3DJv7UeCEq62hGA10BwA%40mail.gmail.com.

Raspunde prin e-mail lui