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.\)\@<=\).
Since restricting the match to inside the entire selection is such a
common use case (see the related vis.vim plugin), I think it would be
worthwhile to have a special atom (e.g. \%<V) that matches if the
_preceding character_ is inside the selection, allowing this much nicer
pattern: /\%Vfoobar\%<V

-- 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