about summary refs log tree commit diff
path: root/Completion/Core/_oldlist
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-15 12:01:46 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-15 12:01:46 +0000
commit35b2633ad941966f5fca07b625a594a5b68c0fdb (patch)
treeb54740d014e594ba5d81931cdcdb3387bcf9dfca /Completion/Core/_oldlist
parentbb98460a01ce1f6c1e71f7e401f782c81b71486b (diff)
downloadzsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.gz
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.xz
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.zip
manual/8639
Diffstat (limited to 'Completion/Core/_oldlist')
-rw-r--r--Completion/Core/_oldlist26
1 files changed, 17 insertions, 9 deletions
diff --git a/Completion/Core/_oldlist b/Completion/Core/_oldlist
index 2efc08119..2408613da 100644
--- a/Completion/Core/_oldlist
+++ b/Completion/Core/_oldlist
@@ -1,18 +1,26 @@
 #autoload
 
+local curcontext="$curcontext" list menu
+
+# Probably set initial context.
+
+[[ -z "$curcontext" ]] && curcontext=':oldlist'
+
+_style -s '' list list
+_style -s '' menu menu
+
 # If this is a listing widget and there is already an old list,
-# and either the compconfig key oldlist_list is `always', or it is not `never'
+# and either the style :oldlist:list is `always', or it is not `never'
 # and the list is not already shown, then use the existing list for listing
 # (even if it was generated by another widget).
 # Do this also if there is an old list and it was generated by the
 # completer named by the oldlist_list key.
-if [[ -n $compstate[old_list] && $compconfig[oldlist_list] != never ]]; then
-  if [[ $WIDGET = *list* &&
-        ( $compconfig[oldlist_list] = always ||
-	  $compstate[old_list] != shown ) ]]; then
+
+if [[ -n $compstate[old_list] && $list != never ]]; then
+  if [[ $WIDGET = *list* && ( $list = always || $list != shown ) ]]; then
     compstate[old_list]=keep
     return 0
-  elif [[ $compconfig[oldlist_list] = *${_lastcomp[completer]}* ]]; then
+  elif [[ $list = *${_lastcomp[completer]}* ]]; then
     [[ "$_lastcomp[insert]" = unambig* ]] && compstate[to_end]=single
     compstate[old_list]=keep
     if [[ -o automenu ]]; then
@@ -25,16 +33,16 @@ if [[ -n $compstate[old_list] && $compconfig[oldlist_list] != never ]]; then
 fi
 
 # If this is a completion widget, and we have a completion inserted already,
-# and the compconfig key oldlist_menu is not never, then we cycle through the
+# and the style :oldlist:menu is not never, then we cycle through the
 # existing list (even if it was generated by another widget).
 
-if [[ $compconfig[oldlist_menu] = verbose &&
+if [[ $menu = verbose &&
       $LASTWIDGET = _verbose_list && $WIDGET != _verbose_list &&
       -z $compstate[old_insert] &&
       -n $compstate[old_list] ]]; then
   compstate[old_list]=keep
 elif [[ $WIDGET = *complete(|-prefix|-word) &&
-      $compconfig[oldlist_menu] != (never|verbose) ]]; then
+        $menu != (never|verbose) ]]; then
   if [[ -n $compstate[old_insert] ]]; then
     compstate[old_list]=keep
     if [[ $WIDGET = *reverse* ]]; then