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

Re: Saving the zle display stuff



Oliver Kiddle wrote:

> Is it possible to have a zle widget which saves any text (completion
> list etc) which is below the prompt (as if ALWAYS_LAST_PROMPT was set
> when the list was generated). The nearest I can get to this is:
> save_list() {
>   unsetopt alwayslastprompt
>   zle list-choices
>   setopt alwasylastprompt
> }
> 
> This would be particularly useful with _complete_help where I often want
> to cut-and-paste to a zstyle command or refer back to the information
> later.
> 
> I'd guess that zle prints lists and doesn't remember where it finished
> so this isn't easy to do. If this is correct, the solution may relate to
> the stuff with calling zle from traps and establishing if there is a
> completion list from there.

It would be relatively easy to make it remember how long the list
below the prompt is (it should already know about the presence of a
list -- at least in most cases).

So, are you suggesting a zle-option to make it put the prompt `below
the list if there is one'?


If you are only concerned about completion: there is the last-prompt
style. But unfortunately, this doesn't work with _complete_help
because that doesn't set up it's own $curcontext, and, I think, it
shouldn't because we call it to get information about normal
completion in the same context. Hm. We could make _complete_help test
the last-prompt style directly with a context like
`:completion:complete-help::::' and if it is true, set
`compstate[last_prompt]=yes'.


Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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