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.
--
% cat /usr/include/sys/errno.h
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
[...]
#define EMACS 666 /* Too many macros */
%
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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.