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

Re: Hmm, something wrong with _multi_parts?



Bart Schaefer wrote:

> The doc says:
> 
> _multi_parts SEP ARRAY
>      This function gets two arguments: a separator character and an
>      array.  As usual, the ARRAY may be either the name of an array
>      parameter or a literal array in the form `(foo bar)' (i.e. a list
>      of words separated by white space in parentheses). [...]
> 
> But if I call it with "a literal array in the form `(foo bar)'" it behaves
> very strangely.  Stuffing the same strings into an actual array and then
> using the name of that array works as I expect.

Oops.

Bye
 Sven

diff -ru ../z.old/Completion/Core/_multi_parts Completion/Core/_multi_parts
--- ../z.old/Completion/Core/_multi_parts	Fri Feb 18 15:42:42 2000
+++ Completion/Core/_multi_parts	Mon Feb 21 10:13:47 2000
@@ -31,7 +31,7 @@
 
 sep="$1"
 if [[ "${2[1]}" = '(' ]]; then
-  matches=( ${2[2,-2]} )
+  matches=( ${=2[2,-2]} )
 else
   matches=( "${(@P)2}" )
 fi

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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