On Tue, 4 Jun 2013, Ron Aaron wrote:
On Tuesday, June 4, 2013 11:30:09 PM UTC+3, ZyX wrote:
`\(foo\)\@=` highlights f and matches zero-width as expected. If on
your system it does something else it is a bug.
Once again, the help states:
Note that using "\&" works the same as using "\@=": "foo\&.." is the
same as "\(foo\)\@=..". But using "\&" is easier, you don't need the
braces.
But if you try the two with "hls", you will see that they do *not*
have the same effect. In the example there, "foo" is highlighted in
the \@= case but only "f" is in the "\&" case. So at the very least,
the help is incorrect.
The trailing '..' in both examples is important. I get the same
highlighting ('fo') with either of:
/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?)
--
Best,
Ben
--
--
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.