Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH (?) Re: strange completion
- X-seq: zsh-workers 29435
 
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
 
- To: zsh-workers@xxxxxxx, sergio <mailbox@xxxxxxxxxxxxx>
 
- Subject: PATCH (?) Re: strange completion
 
- Date: Thu, 02 Jun 2011 07:13:46 -0700
 
- In-reply-to: <4DE765F2.5000704@sergio.spb.ru>
 
- List-help: <mailto:zsh-workers-help@zsh.org>
 
- List-id: Zsh Workers List <zsh-workers.zsh.org>
 
- List-post: <mailto:zsh-workers@zsh.org>
 
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
 
- References: <4DE6ABF6.10405@sergio.spb.ru>	<110601194609.ZM14369@torch.brasslantern.com>	<4DE765F2.5000704@sergio.spb.ru>
 
[>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