From: Greg Klanderman <gak@klanderman.net>
To: zsh-workers@sunsite.dk
Subject: Re: file completion of ~user/... stats wrong directory
Date: Wed, 09 Sep 2009 00:32:48 -0400 [thread overview]
Message-ID: <m3my54ohzj.fsf@klanderman.net> (raw)
In-Reply-To: <200907101421.n6AELWFS028008@news01.csr.com> (Peter Stephenson's message of "Fri, 10 Jul 2009 15:21:32 +0100")
>>>>> On July 10, 2009 Peter Stephenson <pws@csr.com> wrote:
> Certainly sounds plausible. It's odd this isn't an ever worse problem,
> but _path_files has so many possibilities it's surprisingly hard to
> trigger particular problems.
Looks like this is being caused by the 'accept-exact-dirs' logic in
_path_files:
| if zstyle -t ":completion:${curcontext}:paths" accept-exact-dirs &&
| [[ $pre = (#b)(*)/([^/]#) ]]; then
| # We've been told that we can accept an exact directory
| # prefix immediately. Try this with the longest path prefix
| # first: this saves stats in the simple case and may get around
| # automount behaviour if early components don't yet exist.
| tmp1=$match[1]
| tpre=$match[2]
| while true; do
| if [[ -d $donepath$tmp1 ]]; then
| donepath=$donepath$tmp1/
| pre=$tpre
| break
| elif [[ $tmp1 = (#b)(*)/([^/]#) ]]; then
| tmp1=$match[1]
| tpre=$match[2]/$tpre
| else
| break
| fi
| done
| fi
When completing something of the form ~user/foo or $bar/foo, the test
[[ -d $donepath$tmp1 ]] is stat'ing the path 'foo' relative to the
current directory rather than with the stripped off prefix re-added.
greg
next prev parent reply other threads:[~2009-09-09 4:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-09 17:53 Greg Klanderman
2009-07-10 9:07 ` Peter Stephenson
2009-07-10 14:06 ` Greg Klanderman
2009-07-10 14:21 ` Peter Stephenson
2009-09-09 4:32 ` Greg Klanderman [this message]
2009-09-10 15:07 ` Greg Klanderman
2009-09-10 15:47 ` Bart Schaefer
2009-09-10 15:56 ` Greg Klanderman
2009-09-13 16:52 ` Greg Klanderman
2009-09-15 0:41 ` Greg Klanderman
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=m3my54ohzj.fsf@klanderman.net \
--to=gak@klanderman.net \
--cc=zsh-workers@sunsite.dk \
/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).