> The trailing '..' in both examples is important.  I get the same 
> highlighting ('fo') with either of:

Ah, I missed these dots. But still the OP says that with those two dots `foo` 
is highlighted and not `fo`. 

> /foo\&..
> and
> /\(foo\)\@=..
> 
> In both vim 7.3.266 and 7.3.1115 (with both &re=1 and &re=2).
> 
> However, using the example provided with :help /\@= and modifying it to 
> use /\&, I get what you're seeing:
> 
> /foo\(bar\)\@=   -- highlights foo
> /foo\(bar\)\&    -- highlights just the 'f' [equivalent to: /foobar\& ]
> 
> The following highlights foo:
> /foo\(bar\&\)    -- highlights just the 'f'
> 
> This is what I would expect to see, though.  Do you think the help needs 
> to be worded better?  (Explaining that /\& is the same as /\@= with 
> higher precedence than grouping?)

I would rather just use slightly more complex regex in the example: 
`fo\(o\)\&.` is the same as `\%(fo\(o\)\)\@=.`. Everything what is needed is 
explained under `:h /branch`. Also note that I am using `\%(\)`: `foo\&` is 
*not* the same as `\(foo\)\@=` due to capturing groups.

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