Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: file completion of ~user/... stats wrong directory
- X-seq: zsh-workers 27254
- From: Greg Klanderman <gak@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: file completion of ~user/... stats wrong directory
- Date: Wed, 09 Sep 2009 00:32:48 -0400
- In-reply-to: <200907101421.n6AELWFS028008@xxxxxxxxxxxxxx> (Peter Stephenson's message of "Fri, 10 Jul 2009 15:21:32 +0100")
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <19030.11925.370937.608524@xxxxxxxxxxxxxxxxxx> <20090710100721.56b0874c@news01> <m31vooljj7.fsf@xxxxxxxxxxxxxx> <200907101421.n6AELWFS028008@xxxxxxxxxxxxxx>
- Reply-to: gak@xxxxxxxxxxxxxx
>>>>> On July 10, 2009 Peter Stephenson <pws@xxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author