From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Cancel zle -M on a keypress, use cursor keys
Date: Wed, 20 Jan 2016 11:27:55 +0100 [thread overview]
Message-ID: <CAKc7PVDf8u9=ticMoc2_NWgo-qXXyLK4=bn7f=YOZmT4dwOdjQ@mail.gmail.com> (raw)
In-Reply-To: <160118093457.ZM6610@torch.brasslantern.com>
On 18 January 2016 at 18:34, Bart Schaefer <schaefer@brasslantern.com> wrote:
> I think you want to invoke "zle recursive-edit" with its own private
> keymap.
This was quite easy, this is nearly the whole code required (the rest
is first_call initialization):
+if (( first_call ));then
+ zle recursive-edit -K main
+ zle -M ""
+fi
It gives a special mode exited by e.g. enter key, what's signalized by
zle -M "". I had to use $first_call variable because LASTWIDGET is
left unchanged (and points to e.g. vi-backward-char) when
zew-history-complete-word is called for the second time, i.e. right
after zle recursive-edit.
> The other way is to use "read -k" in in a loop, for which the most
> detailed (though now fairly old and probably improvable) example is
> Functions/Zle/incremental-complete-word.
This might be better because now zle -M "...\n...\n..." gives blinks
(when holding "next entry" key).That's maybe connected to keyboard
usage, as I did a short test: called zew-history-complete-word 1000
times recursively, and zle -M "...\n...\n..." didn't blink then. read
-k might change how keys influences the display. Or maybe it's because
that currently the widget exits after each recognized keystroke, but
not sure how this could influence zle -M.
Best regards,
Sebastian Gniazdowski
prev parent reply other threads:[~2016-01-20 10:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-18 9:47 Sebastian Gniazdowski
2016-01-18 17:34 ` Bart Schaefer
2016-01-20 10:27 ` Sebastian Gniazdowski [this message]
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='CAKc7PVDf8u9=ticMoc2_NWgo-qXXyLK4=bn7f=YOZmT4dwOdjQ@mail.gmail.com' \
--to=sgniazdowski@gmail.com \
--cc=schaefer@brasslantern.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).