Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: the function to show a digit argument while it is being typed
- X-seq: zsh-users 14555
- From: Greg Klanderman <gak@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: the function to show a digit argument while it is being typed
- Date: Wed, 11 Nov 2009 17:14:21 -0500
- In-reply-to: <m38wec7n39.fsf@xxxxxxxxxxxxxx> (Greg Klanderman's message of "Wed, 11 Nov 2009 16:44:58 -0500")
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <10081257897632@xxxxxxxxxxxxxxxxxxx> <237967ef0911101822g5bfcf4fao25fc33ba0a2e8604@xxxxxxxxxxxxxx> <091110204748.ZM28704@xxxxxxxxxxxxxxxxxxxxxx> <237967ef0911102217m1325dc59y8d7388e9f6f21c7b@xxxxxxxxxxxxxx> <091111001419.ZM28852@xxxxxxxxxxxxxxxxxxxxxx> <m3eio56o4i.fsf@xxxxxxxxxxxxxx> <091111094507.ZM30174@xxxxxxxxxxxxxxxxxxxxxx> <m3bpj87vgp.fsf@xxxxxxxxxxxxxx> <091111114610.ZM30405@xxxxxxxxxxxxxxxxxxxxxx> <m38wec7n39.fsf@xxxxxxxxxxxxxx>
- Reply-to: gak@xxxxxxxxxxxxxx
This seems to work:
function neg-argument-show () {
emulate -R zsh
if [[ $LASTWIDGET == neg-argument || $LASTWIDGET == digit-argument ]] ; then
zle beep
return
fi
zle -M "arg: -"
zle -R
zle .neg-argument
if zle read-command ; then
[[ $REPLY != digit-argument ]] && zle -M ""
else
zle send-break
fi
[[ -n $KEYS ]] && zle -U $KEYS
}
Any suggestions for improvements?
Greg
Messages sorted by:
Reverse Date,
Date,
Thread,
Author