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

PATCH: special-dirs



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