From 27c1ca8628b03943768c8d9ebfdac1a46ec41374 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 9 Apr 2010 11:57:37 +0000 Subject: Ben: 27589: improved -redirect --- ChangeLog | 7 ++++++- Completion/Zsh/Context/_redirect | 12 +++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ef0532d6..ff123b5d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-04-09 Peter Stephenson + + * Ben: 27589: Completion/Zsh/Context/_redirect: attempt + to use arguments better. + 2010-03-30 Clint Adams * 27847: Completion/Unix/Command/_uzbl: completion for uzbl. @@ -12983,5 +12988,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4948 $ +* $Revision: 1.4949 $ ***************************************************** diff --git a/Completion/Zsh/Context/_redirect b/Completion/Zsh/Context/_redirect index b33e785ee..e6da5d115 100644 --- a/Completion/Zsh/Context/_redirect +++ b/Completion/Zsh/Context/_redirect @@ -6,11 +6,13 @@ _set_command strs=( -default- ) -if [[ -n "$_comp_command1" ]]; then - strs=( "${_comp_command1}" "$strs[@]" ) - [[ -n "$_comp_command2" ]] && +if [[ "$CURRENT" != "1" ]]; then + strs=( "${_comp_command}" "$strs[@]" ) + if [[ -n "$_comp_command1" ]]; then + strs=( "${_comp_command1}" "$strs[@]" ) + [[ -n "$_comp_command2" ]] && strs=( "${_comp_command2}" "$strs[@]" ) + fi fi -_dispatch -redirect-,${compstate[redirect]},${_comp_command} \ - -redirect-,{${compstate[redirect]},-default-},${^strs} +_dispatch -redirect-,{${compstate[redirect]},-default-},${^strs} -- cgit 1.4.1