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

get text of buffer before completion



Hello, I am trying to create a widget that should work like this:
1. when I am doing menu-completion, the widget should save the content of
the buffer before the last completion (the text added by the last call to a
completion widget such as expand-or-complete-prefix)
2. then execute the whole buffer
3. than show again (like accept-and-hold does) the previous buffer as saved
in step 1

eg if I am on a line like this:

ls abc/

and pressing TAB complete like this:

ls abc/def

accepting this with my custom widget (when still in menu selection) should
execute the buffer and then return to the prompt with a buffer containing

ls abc/

IDK if the "when still in menu selection" is relevant, but I included it in
case it is helpful (maybe there are variables populated there that are
discarded when the completion has already been accepted/there is only one
alternative, although using typeset from a widget hasn't shown such
variables though).

thanks

-- 
Pier Paolo Grassi
email: pierpaolog@xxxxxxxxx
linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
founder: https://www.meetup.com/it-IT/Machine-Learning-TO


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