Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Cancel zle -M on a keypress, use cursor keys
- X-seq: zsh-users 21167
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Cancel zle -M on a keypress, use cursor keys
- Date: Wed, 20 Jan 2016 11:27:55 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=teM/ZgGrBrP0lvu3oXwRM5Eri4LMjGnpEg/R9vy7u/k=; b=i2rEs/LuBV2JLSKLSl+zunDiVtEPKKH8Qfh0aT4/1MtmtFShooWQn0vcf8/jCeqIa4 XCMX+EjPM6S7qBsgrnCJWyEFROHh+ULQQCy+CBW33qMRJwYaVnluFkDxk0KyhNhi9T/j YBaEiJiqmBA751/E+tjxA9WNM3i9Nq+CwuB7Q43L0Ih9BgbtzE/35ufz/is5FPewF7FT UzXfnA5GzPYgXrnAn6tjNfsxt/AlamEzOjW9N3imF1sBiFnIiGfe3NB1g1S2GIQsPwWx +wsK9pRv3L0q/X9jpcpAaG3WLcCdVlb5VJMXGkQ53BAByOn3DZbSx0cbR+8AbTA7jc/O jIOg==
- In-reply-to: <160118093457.ZM6610@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBTegpZQxfa4R+HjzWYTpeZKAUxLEARAEu7Zhat+QoKTw@mail.gmail.com> <160118093457.ZM6610@torch.brasslantern.com>
On 18 January 2016 at 18:34, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author