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

PATCH (?) Re: strange completion



[>zsh-workers]

On Jun 2,  2:29pm, sergio wrote:
} Subject: Re: strange completion
}
} This is list-dirs-first bug.
} If I comment this string:
} zstyle ':completion:*' list-dirs-first true
} all works fine.

Hmm; this is actually a problem (?) in _path_files when evaluating the
"fake-files" style.

I'm not sure whether the following is the correct fix, or whether that
entire if/elif/else cascade should be wrapped in

    if [[ -n "$fake" ]]; then

because all the branches pass a (possibly empty) $fake to compfiles.

Index: Completion/Unix/Type/_path_files
===================================================================
--- Completion/Unix/Type/_path_files	1 Jun 2011 06:39:59 -0000
+++ Completion/Unix/Type/_path_files	2 Jun 2011 14:07:00 -0000
@@ -438,7 +438,7 @@
 
     tmp2=( "$tmp1[@]" )
 
-    if [[ "$tpre$tsuf" = */* ]]; then
+    if [[ "$tpre$tsuf" = */* && -n "$fake" ]]; then
       compfiles -P$cfopt tmp1 accex "$skipped" "$_matcher $matcher[2]" "$sdirs" fake
     elif [[ "$sopt" = *[/f]* ]]; then
       compfiles -p$cfopt tmp1 accex "$skipped" "$_matcher $matcher[2]" "$sdirs" fake "$pats[@]"



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