Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Completion/User/_cvs again.



On Sep 8,  7:58am, Tanaka Akira wrote:
> Subject: Re: PATCH: Completion/User/_cvs again.
> In article <990907222631.ZM11028@xxxxxxxxxxxxxxxxxxxxxxx>,
>   "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> writes:
> 
> > maybe a bit less readable ...
> 
> +    _cvs_"${${(k)cmds[(R)* $words[1] *]}:-${words[1]:#*~(${(@kj:|:)~cmds})}}"

I think we've just gone from "a bit" to "a lot".  How about:

Index: Completion/User/_cvs
===================================================================
@@ -35,7 +35,7 @@
   if (( CURRENT == 1 )); then
     compadd "$@" ${(k)cmds} || compadd "$@" ${(kv)=cmds}
   else
-    _cvs_"${${(k)cmds[(R)* $words[1] *]}:-${words[1]:#*~(${(@kj:|:)~cmds})}}"
+    _cvs_"${${(k)cmds[(R)* $words[1] *]}:-${(k)cmds[(i)$words[1]]}}"
   fi
 }
 



Messages sorted by: Reverse Date, Date, Thread, Author