about summary refs log tree commit diff
path: root/Completion/Zsh/Context/_redirect
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Zsh/Context/_redirect')
-rw-r--r--Completion/Zsh/Context/_redirect15
1 files changed, 7 insertions, 8 deletions
diff --git a/Completion/Zsh/Context/_redirect b/Completion/Zsh/Context/_redirect
index 5e454014b..b33e785ee 100644
--- a/Completion/Zsh/Context/_redirect
+++ b/Completion/Zsh/Context/_redirect
@@ -1,17 +1,16 @@
 #compdef -redirect-
 
-# This searches for `<command-name>:<redir-op>' and `<redir-op>', where
-# `<redir-op>' is something like `<' or `2>'.
-
-local strs _comp_command1 _comp_command2
+local strs _comp_command1 _comp_command2 _comp_command
 
 _set_command
 
-strs=( "$compstate[redirect]" )
+strs=( -default- )
 
 if [[ -n "$_comp_command1" ]]; then
-  strs=( "${_comp_command1}:$strs[-1]" "$strs[@]" )
-  [[ -n "$_comp_command2" ]] && strs=( "${_comp_command2}:$strs[1]" "$strs[@]" )
+  strs=( "${_comp_command1}" "$strs[@]" )
+  [[ -n "$_comp_command2" ]] &&
+      strs=( "${_comp_command2}" "$strs[@]" )
 fi
 
-_dispatch -d redirs "$strs[@]"
+_dispatch -redirect-,${compstate[redirect]},${_comp_command} \
+          -redirect-,{${compstate[redirect]},-default-},${^strs}