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

Re: java class names completion widget



On Thursday 15 June 2006 20:19, Peter Stephenson wrote:

> _expand_java_path now contains:
>
>   #autoload
>   local MATCH MBEGIN MEND pref suf
>
>   pref="**/${PREFIX//(#m)[[:upper:]]/${MATCH}[^[:upper:]]#}"
>   suf="${SUFFIX//(#m)[[:upper:]]/${MATCH}[^[:upper:]]#}*.java"
>
>   local expl
>   local -a exp
>   exp=(${~pref}${~suf}(N))
>   if (( ${#exp} )); then
>     _wanted java-files expl 'java source file (search)' \
>       compadd -U -a exp
>   else
>     return 1
>   fi
>

Great!
It took me around 2 hours to understand how these 12 lines work, and I'm still 
a bit confused by the magic happening behind _wanted :)

Many thanks

-- 
/KoS
* I Print on Steel with an Industrial Laser			      



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