zsh-workers
 help / color / mirror / code / Atom feed
From: Greg Klanderman <gak@klanderman.net>
To: Zsh list <zsh-workers@zsh.org>
Subject: make svn url-schemas completion configurable
Date: Wed, 16 Dec 2009 15:49:59 -0500	[thread overview]
Message-ID: <19241.18423.971888.1390@gargle.gargle.HOWL> (raw)


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


                 reply	other threads:[~2009-12-16 20:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19241.18423.971888.1390@gargle.gargle.HOWL \
    --to=gak@klanderman.net \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).