Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: special-dirs
- X-seq: zsh-workers 9335
 
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
 
- To: zsh-workers@xxxxxxxxxxxxxx
 
- Subject: PATCH: special-dirs
 
- Date: Tue, 18 Jan 2000 10:53:46 +0100 (MET)
 
- Cc: Andy Spiegl <Andy@xxxxxxxxx>
 
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
 
After several mails from Andy Spiegel I finally realised that (and
how) the special-dirs style wasn't tested correctly. Especially with
GLOB_DOTS set. This should fix it.
Andy: does it work now?
Bye
 Sven
diff -ru ../z.old/Completion/Core/_path_files Completion/Core/_path_files
--- ../z.old/Completion/Core/_path_files	Mon Jan 17 13:54:45 2000
+++ Completion/Core/_path_files	Tue Jan 18 09:17:23 2000
@@ -264,27 +264,26 @@
 
     if [[ "$tpre$tsuf" = */* ]]; then
       tmp2=( ${^tmp1}*(-/) )
-      if [[ ! -o globdots && "$PREFIX" = .* ]]; then
-        tmp2=( "$tmp2[@]" ${^tmp1}.*(-/) )
-	if zstyle -s ":completion${curcontext}:paths" special-dirs atmp; then
-	  if [[ "$atmp" = (yes|true|1|on) ]]; then
-	    tmp2=( "$tmp2[@]" . .. )
-	  elif [[ "$atmp" = .. ]]; then
-	    tmp2=( "$tmp2[@]" .. )
-          fi
+      [[ ! -o globdots && "$PREFIX" = .* ]] &&
+          tmp2=( "$tmp2[@]" ${^tmp1}.*(-/) )
+      if [[ -o globdots || "$PREFIX" = .* ]] &&
+         zstyle -s ":completion${curcontext}:paths" special-dirs atmp; then
+	if [[ "$atmp" = (yes|true|1|on) ]]; then
+	  tmp2=( "$tmp2[@]" . .. )
+	elif [[ "$atmp" = .. ]]; then
+	  tmp2=( "$tmp2[@]" .. )
         fi
       fi
     else
       tmp2=( ${^tmp1}${^~pats} )
-      if [[ ! -o globdots && "$PREFIX" = .* ]]; then
-        tmp2=( "$tmp2[@]" ${^tmp1}.${^~pats} )
-        if [[ "$sopt" = */* ]] &&
-	   zstyle -s ":completion${curcontext}:paths" special-dirs atmp; then
-	  if [[ "$atmp" = (yes|true|1|on) ]]; then
-	    tmp2=( "$tmp2[@]" . .. )
-	  elif [[ "$atmp" = .. ]]; then
-	    tmp2=( "$tmp2[@]" .. )
-          fi
+      [[ ! -o globdots && "$PREFIX" = .* ]] &&
+          tmp2=( "$tmp2[@]" ${^tmp1}.${^~pats} )
+      if [[ "$sopt" = *[/f]* && ( -o globdots || "$PREFIX" = .* ) ]] &&
+	 zstyle -s ":completion${curcontext}:paths" special-dirs atmp; then
+	if [[ "$atmp" = (yes|true|1|on) ]]; then
+	  tmp2=( "$tmp2[@]" . .. )
+	elif [[ "$atmp" = .. ]]; then
+	  tmp2=( "$tmp2[@]" .. )
         fi
       fi
     fi
--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author