2014-03-30 15:32 GMT+04:00 Yasuhiro MATSUMOTO <[email protected]>:

> index(sprit("こんにちわ世界", "\zs"), "世") should return 5
>
>
It does, but you have 2 typos: not sprit but split, and \zs should be in
single quotes, not double:

index(split("こんにちわ世界", '\zs'), "世")

But anyway all these "solutions" are so dirty hacks. We have to use regexps
to just get position of char (i.e. "unicode codepoint" ). Ewww. I wrote a
patch for PreciseJump plugin so that it works correctly now, but it wasn't
fun: for each match I need to store both byte offset and unicode_codepoint
offset, because I need unicode_codepoint offset for getting needed char
from the list, but I also need byte offset for creating highlight regexp.

More, this plugin's job is to replace matched characters with "keys" that
are usually just english letters and digits (i.e. single-byte chars), so
that I have to care about changing indices if I change multi-byte char to
the single-byte char (i.e. "key").

I believe Vim needs to have better API for that. In order to keep backward
compatibility, new set of functions mb.....() is good solution.

By the way, Andre Sihera, thank you for support. I was afraid I'm the only
who thinks it's ugly behavior.

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui