Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Bug in ${(z)...} lexing, or what?
- X-seq: zsh-workers 12224
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Bug in ${(z)...} lexing, or what?
- Date: Wed, 12 Jul 2000 08:25:15 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
This has me baffled.
Consider the following innocuous-looking function:
widget() {
zle up-history
lastcmd=( ${(z)BUFFER} )
zle down-history
}
Now try this:
zagzig% zle -N widget
zagzig% bindkey '\e=' widget
zagzig% ( setopt extendedglob ; [[ 'foo[x]=y' = (#i)[[:alpha:]][][[:alnum:]]#=* ]] )
zagzig% echo $lastcmd
( setopt extendedglob ; [[ 'foo[x]=y' = ( ;
zagzig%
What happened to everything after the '#' in '(#i)' ?? And where did that
extra semicolon come from?
The really strange thing is that this happens only in ZLE widgets, and only
when there's a command separator (semi, amper, pipe, etc.) somewhere to the
left of the [[ ]] expression. If I try the same thing outside of ZLE, it
works perfectly; if I try a bare glob (not in [[ ... ]]) it also works.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author