about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Zsh/Command/_command10
-rw-r--r--Completion/Zsh/Command/_hash3
-rw-r--r--Completion/Zsh/Command/_which2
-rw-r--r--Completion/Zsh/Context/_equal4
-rw-r--r--Completion/Zsh/Type/_command_names2
5 files changed, 11 insertions, 10 deletions
diff --git a/Completion/Zsh/Command/_command b/Completion/Zsh/Command/_command
index b90ec933e..72d7b6e99 100644
--- a/Completion/Zsh/Command/_command
+++ b/Completion/Zsh/Command/_command
@@ -1,10 +1,12 @@
 #compdef command
 
+local ret
+
 if [[ CURRENT -ge 3 ]]; then
   compset -n 2
-  _normal
+  _normal && ret=0
 else
-  local expl
-
-  _wanted commands expl 'external command' compadd "$@" -k commands
+  _path_commands "$@" && ret=0
 fi
+
+return ret
diff --git a/Completion/Zsh/Command/_hash b/Completion/Zsh/Command/_hash
index 80c136118..d4bb59d28 100644
--- a/Completion/Zsh/Command/_hash
+++ b/Completion/Zsh/Command/_hash
@@ -33,7 +33,8 @@ if [[ $state = hashval ]]; then
   elif compset -P 1 '*='; then
     _wanted -C value values expl 'executable file' _files -g '*(-*)' && ret=0
   else
-    _wanted -C name commands expl command compadd -q -S '=' -k commands && ret=0
+    curcontext="${curcontext%:*}:name"
+    _path_commands -q -S '=' && ret=0
   fi
 fi
 
diff --git a/Completion/Zsh/Command/_which b/Completion/Zsh/Command/_which
index 2b89112bc..07ede39fd 100644
--- a/Completion/Zsh/Command/_which
+++ b/Completion/Zsh/Command/_which
@@ -28,7 +28,7 @@ if [[ "$state" = command ]]; then
   args=( "$@" )
 
   _alternative -O args \
-    'commands:external command:compadd -k commands' \
+    'commands:external command:_path_commands' \
     'builtins:builtin command:compadd -k builtins' \
     'functions:shell function:compadd -k functions' \
     'aliases:alias:compadd -k aliases' \
diff --git a/Completion/Zsh/Context/_equal b/Completion/Zsh/Context/_equal
index a1577d62c..58a415d56 100644
--- a/Completion/Zsh/Context/_equal
+++ b/Completion/Zsh/Context/_equal
@@ -1,5 +1,3 @@
 #compdef -equal-
 
-local expl
-
-_wanted commands expl command compadd -k commands
+_path_commands
diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index 85ca3b912..f57d05226 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -9,7 +9,7 @@ local args defs
 zstyle -t ":completion:${curcontext}:commands" rehash && rehash
 
 defs=(
-  'commands:external command:compadd -k commands'
+  'commands:external command:_path_commands'
 )
 
 [[ -n "$path[(r).]" || $PREFIX = */* ]] &&