Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to make underlining of a command line disappear after an ordinary key press? (2)
- X-seq: zsh-users 14485
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: How to make underlining of a command line disappear after an ordinary key press? (2)
- Date: Mon, 12 Oct 2009 10:03:48 +0100
- In-reply-to: <937889.54824.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <937889.54824.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Guido van Steen wrote:
> ordinary-key-press(){
> if [[ $KEYS = [[:print:]] ]]; then
> region_highlight=("0 0 underline")
> fi
> zle .self-insert
> }
>
> zle -N .self-insert ordinary-key-press
You *don't* want the "." in the zle -N. The whole point of the
dot-commands is that they can't be replaced by user widgets. That's
the same reason you *do* want it in the function.
ordinary-key-press(){
if [[ $KEYS = [[:print:]] ]]; then
region_highlight=("0 0 underline")
fi
zle .self-insert
}
zle -N self-insert ordinary-key-press
There's nothing special about space so long as it's bound to
self-insert; I had no trouble using it.
By the way, if you ever need to undo this, the incantation is
zle -A .self-insert self-insert
---don't simply delete self-insert or you will have trouble typing.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
Messages sorted by:
Reverse Date,
Date,
Thread,
Author