about summary refs log tree commit diff
path: root/Completion/Core/_main_complete
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/_main_complete
parentbb98460a01ce1f6c1e71f7e401f782c81b71486b (diff)
downloadzsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.gz
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.xz
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.zip
manual/8639
Diffstat (limited to 'Completion/Core/_main_complete')
-rw-r--r--Completion/Core/_main_complete21
1 files changed, 14 insertions, 7 deletions
diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete
index f9a8a19ad..ba31399b3 100644
--- a/Completion/Core/_main_complete
+++ b/Completion/Core/_main_complete
@@ -17,10 +17,9 @@
 # state than the global one for which you are completing.
 
 
-local comp post ret=1 _compskip _prio_num=1 _tag_context _cur_contexts
-local context state line opt_args val_args
+local comp post ret=1 _compskip _prio_num=1 _cur_context format
+local context state line opt_args val_args curcontext
 typeset -U _offered_tags _tried_tags _failed_tags _used_tags _unused_tags
-typeset -A _prio_names _prio_contexts _cur_tags _tag_contexts
 
 _offered_tags=()
 _tried_tags=()
@@ -42,7 +41,12 @@ fi
 
 # Get the names of the completers to use in the positional parameters.
 
-(( $# )) || set ${(s.:.)compconfig[completer]}
+if (( ! $# )); then
+  local tmp
+
+  _style -a '' completer tmp
+  set -- "$tmp[@]"
+fi
 
 # And now just call the completer functions defined.
 
@@ -66,9 +70,12 @@ done
 comppostfuncs=()
 
 _lastdescr=( "\`${(@)^_lastdescr:#}'" )
+
+_style -s warnings format format
+
 if [[ compstate[nmatches] -eq 0 &&
       compstate[matcher] -eq compstate[total_matchers] &&
-      -n "$compconfig[warning_format]" && $#_lastdescr -ne 0 ]]; then
+      -n "$format" && $#_lastdescr -ne 0 ]]; then
   local str
 
   compstate[list]=list
@@ -81,10 +88,10 @@ if [[ compstate[nmatches] -eq 0 &&
   *) str="${(j:, :)_lastdescr[1,-2]}, or $_lastdescr[-1]";;
   esac
 
-  compadd -UX "${compconfig[warning_format]//\\%d/$str}" -n ''
+  compadd -UX "${format//\\%d/$str}" -n ''
 fi
 
-[[ "$compconfig[last_prompt]" = always ]] && compstate[last_prompt]=yes
+_style '' last-prompt always && compstate[last_prompt]=yes
 
 _lastcomp=( "${(@kv)compstate}" )
 _lastcomp[completer]="$comp"