about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarlon Richert <marlon.richert@gmail.com>2021-03-17 12:50:57 -0500
committerdana <dana@dana.is>2021-03-17 12:50:57 -0500
commitf4a248f9d38dc02d65610395f4c7f9a95a5d6612 (patch)
tree03083407768c4d2264a2eaf8bca029cc43b072b7
parentf87b73e677739970c61eab55d4a3276beba1bd43 (diff)
downloadzsh-f4a248f9d38dc02d65610395f4c7f9a95a5d6612.tar.gz
zsh-f4a248f9d38dc02d65610395f4c7f9a95a5d6612.tar.xz
zsh-f4a248f9d38dc02d65610395f4c7f9a95a5d6612.zip
48180: Start menu selection with select=long-list in menu style
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Base/Core/_main_complete2
-rw-r--r--Test/Y01completion.ztst34
3 files changed, 41 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 022e38994..b50d6b2b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-03-17  dana  <dana@dana.is>
+
+	* 48180: Marlon Richert: Completion/Base/Core/_main_complete,
+	Test/Y01completion.ztst: Start menu selection with
+	select=long-list in menu style
+
 2021-03-07  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 48147/0002: Functions/Math/zmathfunc, Test/Z02zmathfunc.ztst:
diff --git a/Completion/Base/Core/_main_complete b/Completion/Base/Core/_main_complete
index 663f7557a..169ca1f40 100644
--- a/Completion/Base/Core/_main_complete
+++ b/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 a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index 65f341d49..f6474c4a1 100644
--- a/Test/Y01completion.ztst
+++ b/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