Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Vim syntax file for zsh



On Fri, Dec 10, 2004 at 04:27:49PM +0100, Nikolai Weibull wrote:
> * Stephane Chazelas <Stephane_Chazelas@xxxxxxxx> [Dec 10, 2004 14:40]:
> > > > First, a bug:  The zshVariable rule (after the "How safe is this?"
> > > > comment) is misfiring on any [ that follows word characters.  For
> > > > instance, add "echo hi[" early in a zsh script, and the entire
> > > > script should become the Identifier color.
> 
> > > Well, that [ should be quoted, so I'm not persuaded yet.
> 
> > If that "[" should be quoted, then that one in:
> 
> > [ -n "$1" ]
> 
> > should be to:
> 
> > '[' -ne "$1" ]
> 
> Why?
[...]

Because "[" and "hi[" are both arguments to a builtin command
(0th of the "[" one, and 1st of the "echo" one), there's no
reason (not) to quote one and not the other.

-- 
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author