about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-18 07:36:55 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-18 07:36:55 +0000
commitfe65ab1dd85195ae0bef29f11aea74209c00cb8b (patch)
tree1e435897e589f4e0e66f89ef6128bd5752b4e056 /Completion
parent59da43689af6ca1048f2e956f10c18cd17774f2a (diff)
downloadzsh-fe65ab1dd85195ae0bef29f11aea74209c00cb8b.tar.gz
zsh-fe65ab1dd85195ae0bef29f11aea74209c00cb8b.tar.xz
zsh-fe65ab1dd85195ae0bef29f11aea74209c00cb8b.zip
completion list scrolling cleanup; *STATUS renamed to *PROMPT, styles for new used parameters, use local keymap when waiting at list-prompt (10801)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Builtins/_zstyle3
-rw-r--r--Completion/Core/_main_complete10
2 files changed, 13 insertions, 0 deletions
diff --git a/Completion/Builtins/_zstyle b/Completion/Builtins/_zstyle
index 5f078fddb..a2a19320d 100644
--- a/Completion/Builtins/_zstyle
+++ b/Completion/Builtins/_zstyle
@@ -41,6 +41,7 @@ styles=(
   list			 c:listwhen
   list-colors		 c:
   list-packed		 c:bool
+  list-prompt            c:
   list-rows-first	 c:bool
   local			 c:
   matcher-list		 c:
@@ -55,6 +56,8 @@ styles=(
   prefix-needed		 c:bool
   prompt		 c:
   remove-all-dups	 c:bool
+  select-prompt          c:
+  select-scroll          c:
   single-ignored         c:single-ignored
   sort			 c:bool
   special-dirs		 c:sdirs
diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete
index 795fe7442..0c0bd05b6 100644
--- a/Completion/Core/_main_complete
+++ b/Completion/Core/_main_complete
@@ -56,6 +56,16 @@ _def_menu_style=( "$_last_menu_style[@]"
                 )
 _last_menu_style=()
 
+if zstyle -s ":completion:${curcontext}:default" list-prompt LISTPROMPT &&
+   [[ -n "$LISTPROMPT" ]]; then
+  zmodload -i zsh/complist
+  compstate[list_max]=scroll
+fi
+zstyle -s ":completion:${curcontext}:default" select-prompt SELECTPROMPT ||
+    SELECTPROMPT='%SScrolling active: current selection at %p'
+zstyle -s ":completion:${curcontext}:default" select-scroll SELECTSCROLL ||
+    SELECTSCROLL=1
+
 # Get the names of the completers to use in the positional parameters.
 
 if (( $# )); then