On Wed, June 5, 2013 08:56, Ingo Karkat wrote: > 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.)
I am not sure, it is intended. I certainly wouldn't expect this (and the doc is wrong in this regard, as you said). Since \%V is zero-width, I would expect the \%V to still match the end of the visual selection. > The general case is this ugly beast: /\%Vfoobar\%(\%V\|\%(\%V.\)\@<=\). Yes, very ugly and not easily understandable. > 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 I can understand why this happens but nevertheless it is an annoying corner-case to consider when using the \%V atom, so I'd like to have this issue resolved. regards, Christian -- -- 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.
