about summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-02-16 10:57:11 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-02-16 10:57:11 +0000
commit15996aeeecedf3b94447213ea4c473650cf8afb4 (patch)
tree20970d3968f18652f48047b42c4bc068fb4af35b /Completion/Base
parentd5980018d5423274e4beb771974f4c935b309241 (diff)
downloadzsh-15996aeeecedf3b94447213ea4c473650cf8afb4.tar.gz
zsh-15996aeeecedf3b94447213ea4c473650cf8afb4.tar.xz
zsh-15996aeeecedf3b94447213ea4c473650cf8afb4.zip
zsh-workers/9759
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/_default20
1 files changed, 10 insertions, 10 deletions
diff --git a/Completion/Base/_default b/Completion/Base/_default
index 8329a0358..b84cbff6a 100644
--- a/Completion/Base/_default
+++ b/Completion/Base/_default
@@ -1,16 +1,16 @@
 #compdef -default-
 
-# You can first try the `compctl's by uncommenting the `compcall' line
-# below.
-# This is without first (-T) and default (-D) completion. If you want
-# them add `-T' and/or `-D' to this command. If there is a `compctl'
-# for the command we are working on, we return immediatly. If you want
-# to use new style completion anyway, remove the `|| return'. Also,
-# you may want to use new style completion if the `compctl' didn't
-# produce any matches. In that case remove the `|| return' and insert
-# the line `[[ compstate[nmatches] -eq 0 ]] || return' after `compcall'.
+local ctl
 
-# compcall || return 0
+if { zstyle -s ':completion:${curcontext}:' use-compctl ctl ||
+     zmodload -e zsh/compctl } && [[ "$ctl" != (no|false|0|off) ]]; then
+  local opt
+
+  opt=()
+  [[ "$ctl" = *first* ]] && opt=(-T)
+  [[ "$ctl" = *default* ]] && opt=("$opt[@]" -D)
+  compcall "$opt[@]" || return 0
+fi
 
 _tags files || return 1