From: Marlon Richert <marlon.richert@gmail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>,
Zsh hackers list <zsh-workers@zsh.org>,
Bart Schaefer <schaefer@brasslantern.com>
Subject: Re: Bug + patch: `zstyle ':completion:*' menu select=long-list` fails to start menu selection
Date: Sun, 14 Mar 2021 11:30:14 +0200 [thread overview]
Message-ID: <CAHLkEDsbrW8k_uxF8xoOdPec--fMZDY=TnfeD1o7G6qQOSFobA@mail.gmail.com> (raw)
In-Reply-To: <20210304201721.GA16874@tarpaulin.shahaf.local2>
On Thu, Mar 4, 2021 at 10:17 PM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> Thanks. Haven't reviewed the patch, but assuming it's correct, it'd be
> great to have this test upgraded to a proper regression test; see
> Test/README in the source tree.
OK, I added a test to the patch, which fails before applying the patch
and succeeds afterwards. Please review.
diff --git Completion/Base/Core/_main_complete
Completion/Base/Core/_main_complete
index 663f7557..9d90b0fe 100644
--- Completion/Base/Core/_main_complete
+++ Completion/Base/Core/_main_complete
@@ -244,7 +244,7 @@ if [[ $compstate[old_list] = keep || nm -gt 1 ]]; then
_menu_style=( "$_menu_style[@]" "$_def_menu_style[@]" )
- if [[ "$compstate[list]" = *list && tmp -gt LINES &&
+ if [[ "$compstate[list]" = *list(| *) && tmp -gt LINES &&
( -n "$_menu_style[(r)select=long-list]" ||
-n "$_menu_style[(r)(yes|true|on|1)=long-list]" ) ]]; then
compstate[insert]=menu
diff --git Test/Y01completion.ztst Test/Y01completion.ztst
index 65f341d4..02094cad 100644
--- Test/Y01completion.ztst
+++ Test/Y01completion.ztst
@@ -237,6 +237,40 @@ F:regression test workers/31611
>FI:{file1}
>FI:{file2}
+ comptesteval '_tst() { local disp=( {a..z} ); compadd -ld disp
$disp[@]; comppostfuncs=( _pst ) }'
+ comptesteval '_pst() { local disp=(
"<INSERT>$compstate[insert]</INSERT>" ); compadd -Qld disp $disp }'
+ comptesteval "zstyle ':completion:*' menu select=long-list"
+ comptest $'tst \C-d'
+0: menu select=long-list starts menu selection for list widgets
+>NO:{<INSERT>menu</INSERT>}
+>NO:{a}
+>NO:{b}
+>NO:{c}
+>NO:{d}
+>NO:{e}
+>NO:{f}
+>NO:{g}
+>NO:{h}
+>NO:{i}
+>NO:{j}
+>NO:{k}
+>NO:{l}
+>NO:{m}
+>NO:{n}
+>NO:{o}
+>NO:{p}
+>NO:{q}
+>NO:{r}
+>NO:{s}
+>NO:{t}
+>NO:{u}
+>NO:{v}
+>NO:{w}
+>NO:{x}
+>NO:{y}
+>NO:{z}
+
+
%clean
zmodload -ui zsh/zpty
next prev parent reply other threads:[~2021-03-14 9:31 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-04 8:56 Marlon Richert
2021-03-04 20:17 ` Daniel Shahaf
2021-03-04 22:26 ` Marlon Richert
2021-03-07 17:22 ` Daniel Shahaf
2021-03-09 17:01 ` Marlon Richert
2021-03-09 21:19 ` Daniel Shahaf
2021-03-09 21:48 ` Bart Schaefer
2021-03-10 7:21 ` Marlon Richert
2021-03-10 18:50 ` Bart Schaefer
2021-03-11 2:17 ` Bart Schaefer
2021-03-11 7:33 ` Marlon Richert
2021-03-11 18:22 ` Bart Schaefer
2021-03-12 13:11 ` Marlon Richert
2021-03-12 13:36 ` Peter Stephenson
2021-03-12 14:14 ` Daniel Shahaf
2021-03-12 20:53 ` Mikael Magnusson
[not found] ` <884654866.425858.1615560127191@mail2.virginmedia.com>
2021-03-13 13:40 ` Daniel Shahaf
2021-03-13 17:38 ` Peter Stephenson
2021-03-13 18:08 ` Bart Schaefer
2021-03-14 7:39 ` dana
2021-03-14 9:30 ` Marlon Richert [this message]
2021-03-17 18:01 ` dana
2021-03-25 0:46 ` Daniel Shahaf
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='CAHLkEDsbrW8k_uxF8xoOdPec--fMZDY=TnfeD1o7G6qQOSFobA@mail.gmail.com' \
--to=marlon.richert@gmail.com \
--cc=d.s@daniel.shahaf.name \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@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).