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

Re: globcomplete desctroys file completion

On Wed, 25 Feb 2009 20:39:49 +0000
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> Indeed, comparing with the code in 4.2 (before the $Uopt stuff was added)
> suggests it should probably be something like the following anyway,
> though I don't have the set-up to test whether it helps here.

Scratch that, it's simpler---we never want two -s's, we just want to
ensure $ISUFFIX is there when needed.  This time I do have some evidence
this is doing better things with GLOBCOMPLETE set than previously.

Index: Completion/Unix/Type/_path_files
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_path_files,v
retrieving revision 1.42
diff -u -r1.42 _path_files
--- Completion/Unix/Type/_path_files	29 Jan 2009 17:58:30 -0000	1.42
+++ Completion/Unix/Type/_path_files	25 Feb 2009 20:46:01 -0000
@@ -666,14 +666,13 @@
 	# We are inserting the match into the command line.
         if [[ "$tmp3" = */* ]]; then
 	  tmp4=( $Uopt -Qf "$mopts[@]" -p "${Uopt:+$IPREFIX}$linepath$tmp2"
-	         -s "${Uopt:+$ISUFFIX}"
 	         -W "$prepath$realpath$testpath"
 	         "$pfxsfx[@]" $Mopts )
 	  if [[ -z "$listsfx" ]]; then
             for i in "$tmp1[@]"; do
 	      _list_files tmpdisp "$prepath$realpath$testpath"
-	      compadd "$tmp4[@]" -s "/${i#*/}" $listopts - "$tmpdisp"
+	      compadd "$tmp4[@]" -s "/${i#*/}${Uopt:+$ISUFFIX}" $listopts - "$tmpdisp"
             [[ -n "$compstate[pattern_match]" ]] && SUFFIX="${SUFFIX:s./.*/}*"

Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/

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