zsh-workers
 help / color / mirror / code / Atom feed
* make svn url-schemas completion configurable
@ 2009-12-16 20:49 Greg Klanderman
  0 siblings, 0 replies; only message in thread
From: Greg Klanderman @ 2009-12-16 20:49 UTC (permalink / raw)
  To: Zsh list


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-16 20:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-16 20:49 make svn url-schemas completion configurable Greg Klanderman

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).