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

Re: Fwd: [Pkg-zsh-devel] Bug#793168: zsh: expand-substitution-on-TAB broke for $(()) in 5.0.8 [origin: adi@xxxxxxxxxxxxx]



On Jul 25,  7:03pm, Axel Beckert wrote:
}
} I can also reproduce this issue with zsh 5.0.8 in Debian and can
} confirm, that it didn't happen with zsh 5.0.7 in Debian.
} 
} ----- Forwarded message from Andy Isaacson <adi@xxxxxxxxxxxxx> -----
} 
} with zsh 5.0.7 and earlier versions, if I type $((5*8)) and then hit TAB,
} the expression is replaced with its evaluation ("40" in this case).

This appears to be a difference in behavior of the expand-or-complete
built-in widget.  With _expand added to the completer zstyle or with
the expand-word widget, the behavior is unchanged.

There's no change to the widget itself.  The issue seems to be that
the completion system is examining $((5*8) [without the trailing paren] 
insead of the full expression.  You can see this in action if you
"setopt completealiases"; using "_" to represent the position of the
cursor:

torch% setopt completealiases
torch% echo $((5*8))_<TAB>
[... list of parameter names appears ...]
torch% echo $((5*8)_)

This must in turn be due to the change in the parser to disambiguate
"$((" as either math or command substitution; completion is trying it
as command substitution without looking ahead to see if it can be done
as math instead.



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