On 05-Jun-2013 19:02 +0200, Bram Moolenaar wrote:

> Ingo Karkat wrote:
> 
>> On 05-Jun-2013 13:56 +0200, Andy Wokula wrote:
>>
>>> Am 05.06.2013 08:56, schrieb Ingo Karkat:
>>>> On 05-Jun-2013 08:03 +0200, Christian Brabandt wrote:
>>>>
>>>>> [...] the old engine has an long standing bug with \%V ;(
>>>>>
>>>>> e.g:
>>>>>
>>>>> vim -u NONE -N
>>>>> ifoobar<esc>
>>>>> 0ve<esc>
>>>>> /\%Vfoobar\%V
>>>>>
>>>>> I should have probably provided a fix long ago.
>>>>
>>>> Where is the bug, that there's no match?! That's intended, as the last
>>>> \%V matches zero-width _after_ the end of "foobar", but the visual
>>>> selection ends on the "r". You'd have to use /\%Vfooba\%Vr here. (The
>>>> example at :help \%V is wrong about this corner case, too.)
>>>>
>>>> The general case is this ugly beast: /\%Vfoobar\%(\%V\|\%(\%V.\)\@<=\).
>>>
>>> Keep it simple ...:
>>>     /\%Vfoobar\%(\%V.\)\@<=
>>
>> You're technically right, maybe it was irrational fear of bad
>> performance (from the help: "For speed it's often much better to avoid
>> this multi.") that made me introduce the branch for the common case.
>> Confession: I've never measured this, though.
> 
> It should be a lot faster with a byte length limit:
> 
>      /\%Vfoobar\%(\%V.\)\@1<=

Agreed; I want that syntax, too :-) But honestly, would you want to
write that interactively for each selected-limited search?! (It's fine
for write-once-use-often mappings and commands.) Something like
    /\%Vfoobar\%<V
I would have a chance to remember.

-- regards, ingo

-- 
-- 
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/groups/opt_out.


Raspunde prin e-mail lui