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

Re: PATCH: Add $OVERSTRIKE in zle widgets



On Tue, 03 Aug 2010 11:44:06 +0200
Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
> How would you organise that information? In a string, where multiple
> characters would signify different states? Like ZLE_STATE='mo' meaning
> overwrite mode and a mini-buffer is active.

That's the kind of thing I had in mind, but strings are cheap nowadays, and
[[ ... ]] tests natural in the shell, so you might just it make it verbose
and contain "insert", "overwrite", "minibuffer insert", "minibuffer
overwrite", and test '[[ $ZLE_STATE = *overwrite* ]]', which is completely
unambiguous while the speed penalty is unnoticeable.  Use of this idiom
makes it easy to upgrade the variable in a backward compatible way and
without variable namespace pollution.

I think the "minibuffer", such as it is, is tied to the "statusline"
variable. Some of the code associated with that is a bit grungy (yes, I
know, you're astonished), but mostly I think that's down to how the
minibuffer is generated rather than whether or how it's displayed.

Similarly, there's also "listshown" which relates to whether completion
lists are being displayed, which is somehow related to "showinglist".
Code associated with that is, er, completion code.

-- 
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