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

How to make underlining of a command line disappear after an ordinary key press? (2)



Well, it seems that binding a widget like: 

"""ordinary-key-press(){ 
    region_highlight=("0 0 underline")
    zle .self-insert; 
}
"""

to all ordinary keys by: 

"""zle -N ordinary-key-press
bindkey 'a' ordinary-key-press
...
...
...
bindkey 'Z' ordinary-key-press
bindkey '^[[C' ordinary-key-press # arrow right
bindkey '^[[D' ordinary-key-press # arrow left
...
...
"""

achieves what I had in mind. 

I am still wondering though if the underlining can't be 
turned be done from within the widget 
"underline_cmdline_partially". 

Or can it at least be done without so many bindkey commands? 

Thanks! 

Guido 

--- On Sat, 10/10/09, Guido van Steen <gvsteen@xxxxxxxxx> wrote:

> From: Guido van Steen <gvsteen@xxxxxxxxx>
> Subject: How to make underlining of a command line disappear after an ordinary key press?
> To: zsh-users@xxxxxxxxxx
> Date: Saturday, 10 October, 2009, 5:16 PM
> Hi all, 
> 
> I am trying to write a widget, let me call it 
> "underline_cmdline_partially". Not very urprisingly, 
> its purpose is to underline a part of the command line. 
> It does so by calling something like 
> """region_highlight=("$my_mbegin $MEND underline")""". 
> Now, if the next key pressed is an ordinary key - like 
>  "a" - I would like the partial underlining of the 
> command line to disappear. 
> 
> Is there an easy way to achieve this e.g. by calling 
> "zle_highlight=(region:standout special:standout 
> isearch:underline)" - the default setting - in the 
> widget "underline_cmdline_partially"? 
> 
> Thanks in advance, 
> 
> Guido 
> 
> 
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>




      New Email names for you! 
Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/



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