zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org, sergio <mailbox@sergio.spb.ru>
Subject: PATCH (?) Re: strange completion
Date: Thu, 02 Jun 2011 07:13:46 -0700	[thread overview]
Message-ID: <110602071346.ZM15593@torch.brasslantern.com> (raw)
In-Reply-To: <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[@]"


       reply	other threads:[~2011-06-02 14:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4DE6ABF6.10405@sergio.spb.ru>
     [not found] ` <110601194609.ZM14369@torch.brasslantern.com>
     [not found]   ` <4DE765F2.5000704@sergio.spb.ru>
2011-06-02 14:13     ` Bart Schaefer [this message]
2011-06-03  8:34       ` Bart Schaefer
2011-09-05 19:11         ` Alexey I. Froloff
2011-09-05 20:42           ` Bart Schaefer
2011-09-05 21:34             ` Alexey I. Froloff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=110602071346.ZM15593@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=mailbox@sergio.spb.ru \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).