zsh-users
 help / color / mirror / code / Atom feed
From: Pier Paolo Grassi <pierpaolog@gmail.com>
To: Zsh-Users List <zsh-users@zsh.org>
Subject: get text of buffer before completion
Date: Fri, 25 Jan 2019 16:25:41 +0100	[thread overview]
Message-ID: <CAP+y1xBtKYFwTxUiAR+hSv2OpumnV4VbuZPnbCe=j4D5dBuSBA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

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@gmail.com
linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
founder: https://www.meetup.com/it-IT/Machine-Learning-TO

                 reply	other threads:[~2019-01-25 15:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP+y1xBtKYFwTxUiAR+hSv2OpumnV4VbuZPnbCe=j4D5dBuSBA@mail.gmail.com' \
    --to=pierpaolog@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).