Hi Bram!

On Sa, 20 Apr 2013, Bram Moolenaar wrote:

> 
> Christian Brabandt wrote:
> 
> > I noticed, that searching in Vim for [] will match '[]' literally. This 
> > seems
> > to be a little bit unexpected, because I would either expect to match
> > everything because the collation [] contains nothing, or an error message,
> > since we are missing a closing ']' as grep or awk does (also nvi):
> > 
> > ~$ grep '[]' ~/.vimrc
> > grep: Unmatched [ or [^
> > 
> > At the very least, this special behaviour needs to be documented, but I 
> > tend to consider this behaviour as a bug.
> > 
> > BTW: POSIX says this about it:
> > 
> > ,----
> > | The right-bracket ( ']' ) shall lose its special meaning and represent 
> > itself
> > | in a bracket expression if it occurs first in the list (after an initial
> > | circumflex ( '^' ), if any)
> > `----
> > 
> > This patch makes Vim report an error message:
> 
> I don't like errors...
> 
> I'm not sure if this is an improvement.  And in case of doubt it's
> better to leave it as it is.
> 
> How about adding this to the docs:
> 
>       - Omitting the trailing ] is not considered an error. "[]" works like
>         "[]]", it matches the ']' character.

Okay, this is fine with me.

regards,
Christian
-- 
Nur ein mittelmäßiger Mensch ist immer in Hochform.
                -- William Somerset Maugham

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