Monday, April 25, 2016

Re: Capture columns nummers of matches ending with double byte chars

2016-04-26 0:45 GMT+03:00 rameo <raiwil@gmail.com>:
> Op maandag 25 april 2016 22:26:27 UTC+2 schreef Ken Takata:
>> Hi rameo,
>>
>> 2016/4/23 Sat 21:37:15 UTC+9 rameo wrote:
>> > Searchpos() doesn't return the right end value of a match if the match end with a double byte character (èéòìùá...). (encoding utf-8)
>> > Isn't this a bug????
>>
>> You might misunderstand the spec of searchpos().
>> When the 'e' flag is specified, the cursor moves to the last character of
>> the match and searchpos() returns the position of the cursor. It means
>> that the returned value is a byte index of start of the last character,
>> not the end of the character.
>>
>
> Hello Ken,
>
> thank you for your reply :)
>
> Just a question, why does someone need the byte index of the start of the last character and not simply the end of the last character?
>
>>
>> > The last few years I used match/matchend then I noted that it did not capture correctly double byte characters within the string.
>>
>> Can you show an example?
>> match()/matchend() return a byte offset, not a character count.
>>
>> FYI, matchstrpos() can be used to get both start and end position
>> after 7.4.1685.
>>
>>
>> Regards,
>> Ken Takata
>
> That's great news.
> I waited long for such a feature.
>
> Can you please send me the url of the site where the patches can be downloaded?
> I can't find it anymore.

It is much better to download sources from https://github.com/vim/vim.

>
> --
> --
> You received this message from the "vim_use" 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_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment