From: Bart Schaefer <schaefer@brasslantern.com>
To: Vincent Bernat <bernat@luffy.cx>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Limiting height of completion menu
Date: Sat, 19 Dec 2020 12:30:17 -0800 [thread overview]
Message-ID: <CAH+w=7amMkiuWYHdmCemo5sH+YAADF_drF=iHJ7Wpypv_zGwoQ@mail.gmail.com> (raw)
In-Reply-To: <m3tushaaq2.fsf@luffy.cx>
On Sat, Dec 19, 2020 at 10:53 AM Vincent Bernat <bernat@luffy.cx> wrote:
>
> I was wondering if it would have been possible to limit the height of
> the completion menu. I am using:
>
> zstyle ':completion:*' menu yes=long select
This seems to work:
autoload add-zsh-hook
autoload add-zle-hook-widget
half-lines() {
LINES=$((LINES/2))
}
full-lines() {
# Force terminal query
LINES=0
}
comp-lines() {
full-lines
compprefuncs=( half-lines )
}
add-zsh-hook preexec full-lines
add-zle-hook-widget line-init comp-lines
However, there is an odd side-effect in that the command line is
temporarily garbled if you are NOT using menu-select and the "do you
wish to see all X possibilities" prompt is printed. It fixes itself
as soon as you answer yes/no, but it's curious that it happens in the
first place.
Note it does not work to use comppostfuncs=( full-lines ) ... the
comppostfuncs are run before menu-selection determines the screen
size.
next prev parent reply other threads:[~2020-12-19 20:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-19 18:53 Vincent Bernat
2020-12-19 20:30 ` Bart Schaefer [this message]
2020-12-19 21:05 ` Vincent Bernat
2020-12-19 21:38 ` Vincent Bernat
2020-12-19 22:03 ` Bart Schaefer
2020-12-19 22:12 ` Vincent Bernat
2020-12-19 22:15 ` Bart Schaefer
2020-12-19 22:24 ` Vincent Bernat
2020-12-19 23:26 ` Bart Schaefer
2020-12-19 23:30 ` Vincent Bernat
2020-12-20 14:41 ` Stephane Chazelas
2020-12-20 21:55 ` Bart Schaefer
2020-12-21 12:22 ` Vincent Bernat
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='CAH+w=7amMkiuWYHdmCemo5sH+YAADF_drF=iHJ7Wpypv_zGwoQ@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=bernat@luffy.cx \
--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).