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

make svn url-schemas completion configurable



Another installment in my series of svn completion improvements..
this makes the url-schemas completion configurable with a zstyle.

thanks,
Greg


Index: Completion/Unix/Command/_subversion
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_subversion,v
retrieving revision 1.30
diff -u -r1.30 _subversion
--- Completion/Unix/Command/_subversion	19 Nov 2009 09:48:49 -0000	1.30
+++ Completion/Unix/Command/_subversion	16 Dec 2009 20:43:56 -0000
@@ -249,7 +249,7 @@
 
 (( $+functions[_svn_urls] )) ||
 _svn_urls() {
-  local expl ret=1
+  local urlsch expl ret=1
 
   # first try completing a remote path; if successful, we are all done..
   _svn_remote_paths && return 0
@@ -260,9 +260,13 @@
   _urls -S/ && ret=0
 
   if [[ ! -prefix *://? ]] ; then
-    compset -S '[^:]*'
-    _wanted url-schemas expl 'URL schema' compadd -S '' - \
-        file:// http:// https:// svn:// svn+ssh:// && ret=0
+    zstyle -a ":completion:${curcontext}:" url-schemas urlsch \
+     || urlsch=( file:// http:// https:// svn:// svn+ssh:// )
+    
+    if (( $#urlsch )) ; then
+      compset -S '[^:]*'
+      _wanted url-schemas expl 'URL schema' compadd -S '' - $urlsch[@] && ret=0
+    fi
   fi
 
   return ret



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