On Sat, Dec 26, 2020 at 8:58 AM Yegappan Lakshmanan <yegapp...@gmail.com> wrote:
> Hi, > > The getcurpos() and col() functions return the byte position of the cursor. > Is there a function that returns the character position of the cursor in > the current line? > > The byteidx() function returns the byte index given the character index > in a string. I am looking for the opposite. > > Neovim has the vim.str_utfindex() function that returns the character index of a given byte index in a string: https://neovim.io/doc/user/lua.html#vim.str_utfindex() I am looking for a similar function to use in Vim. - 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 vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAAW7x7knwTHiTa-8%2BcCnMceQDPgx6pXxU_kDzvN1TbAuGCsg9w%40mail.gmail.com.