Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: #compdef lines prevent X11 and init.d completion
- X-seq: zsh-workers 27589
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Zsh Workers <zsh-workers@xxxxxxx>
- Subject: Re: #compdef lines prevent X11 and init.d completion
- Date: Sun, 10 Jan 2010 13:12:33 -0500 (EST)
- In-reply-to: <alpine.LNX.2.01.1001101051310.8115@xxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <alpine.LNX.2.01.1001101051310.8115@xxxxxxxxxxx>
On Sun, 10 Jan 2010, Benjamin R. Haskell wrote:
> [...]
>
> I frequently use <filename as a command unto itself, happily
> tab-completing the whole of filename. But, that line prevents me from
> tab-completing into the /etc/X11 and /usr/share/X11 directories.
>
> [...]
>
> Seems like a bug to me -- not 100% sure where, so I figured I'd ping the
> list before patching it myself.
>
Making _redirect consider whether $CURRENT is 1 seems to solve the
problem for me. Might also make sense to test whether NULLCMD is set.
Not sure if this would have other adverse effects, nor what the mention
of 'ksharrays' in the man page might entail.
Patch attached.
Best,
Ben
Index: Completion/Zsh/Context/_redirect
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Context/_redirect,v
retrieving revision 1.3
diff -u -r1.3 _redirect
--- Completion/Zsh/Context/_redirect 13 Mar 2002 09:28:05 -0000 1.3
+++ Completion/Zsh/Context/_redirect 10 Jan 2010 18:08:50 -0000
@@ -6,11 +6,13 @@
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}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author