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

PATCH: fix suffix handling for completion of svn repository urls



Hi,

This fixes the suffix handling for completion of svn repository urls;
space is added as a suffix for files and '/' for directories, and the
-q flag is added for automatic suffix removal.

I can't say I 100% understand this code, but adding the suffix args
does seem to work correctly.  If someone could explain to me why
'[[ -n $suf ]] &&' is used before the compadd line for the files, but
the compadd for the directories is unqualified, I'd certainly
appreciate having a better understanding.. there are a couple more svn
completion problems I'm hoping to fix.

thanks,
Greg


Index: Completion/Unix/Command/_subversion
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_subversion,v
retrieving revision 1.25
diff -u -r1.25 _subversion
--- Completion/Unix/Command/_subversion	31 Jan 2008 16:16:36 -0000	1.25
+++ Completion/Unix/Command/_subversion	17 May 2009 04:32:22 -0000
@@ -215,9 +215,8 @@
     _tags files
     while _tags; do
       while _next_label files expl ${suf:-directory}; do
-        [[ -n $suf ]] && compadd "$@" "$expl[@]" -d remdispf $remdispf && ret=0
-        compadd ${suf:+-S/} "$@" "$expl[@]" -d remdispd \
-            ${remdispd%/} && ret=0
+        [[ -n $suf ]] && compadd -S ' ' -q "$@" "$expl[@]" -d remdispf $remdispf && ret=0
+        compadd -S "${suf:+/}" -q "$@" "$expl[@]" -d remdispd ${remdispd%/} && ret=0
       done
       (( ret )) || return 0
     done


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