Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
get text of buffer before completion
- X-seq: zsh-users 23846
- From: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
- To: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: get text of buffer before completion
- Date: Fri, 25 Jan 2019 16:25:41 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=0JNjojMxuArqg7MOVom8x1xpPfB5HBp+HoYVa0MC/ps=; b=WS/GMrHvd6uFVwPCBZyDk2nn1f0jhuC0YaVtpn83aPn7Qer8FfSc3A1gojBCkSnoNU 0BhcSV3Gcx3znTVniOCwmkqburoBR73WGn3D6Zsc6ADLQT/tNByrkYi4fdwoGVSJnujC JAQ0GLKdN8EOILV2jWaw9Q92Flsp0mzd5weBtWQgfL0NOEa/VuayJ1ya/ywSD/1ZaDs1 cLoV4kvgLweeVq5zWZmmu3NF4VJT9U8E0n+n/I4B3tMbwSMt7ZQeEFh9FBN2YQJZvfnY nULr04W6GI8vMvvnHj/4uMI6X1C4nl4vLoDCjpcsAb2I/U1draI/5MkEoXX2eP5yJhik Tjkw==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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