From: Peter Stephenson <pws@csr.com>
To: Zsh list <zsh-workers@sunsite.dk>
Subject: Re: bug in accept-exact-dirs style
Date: Thu, 29 Jan 2009 17:51:25 +0000 [thread overview]
Message-ID: <20090129175125.4fd49a32@news01> (raw)
In-Reply-To: <090129082025.ZM15909@torch.brasslantern.com>
On Thu, 29 Jan 2009 08:20:25 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Jan 27, 6:54pm, Greg Klanderman wrote:
> }
> } [~] greg@lwm| zsh -f
> } lwm% mkdir foo
> } lwm% touch foo/bar
> } lwm% touch foo/baz
> } lwm% autoload -U compinit
> } lwm% compinit
> } lwm% zstyle ':completion:*' accept-exact-dirs yes
> }
> } Now try completing each of the following:
> }
> } ls foo/ # OK
> } ls ~/foo/ # doesn't work - no completions
> } ls /home/greg/foo/ # OK
> } ls $HOME/foo/ # doesn't work - no completions
>
> Then the code is fooled into thinking that the suffix is part of the
> prefix, and on line 585 the PREFIX string is rebuilt in the wrong order,
> becoming "tmp/~/" instead of "~/tmp/".
Ah, yes, The bug is at this point, I think. The ordering appears to be
OK for other uses of donepath (though, in _path_files, it's hard
to be sure). Thanks for looking.
Index: Completion/Unix/Type/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_path_files,v
retrieving revision 1.41
diff -u -r1.41 _path_files
--- Completion/Unix/Type/_path_files 10 Nov 2008 15:28:41 -0000 1.41
+++ Completion/Unix/Type/_path_files 29 Jan 2009 17:49:41 -0000
@@ -578,11 +578,11 @@
if [[ "$tpre" = */* ]]; then
tmp2="${cpre}${tpre%%/*}"
- PREFIX="${donepath}${linepath}${tmp2}"
+ PREFIX="${linepath}${donepath}${tmp2}"
SUFFIX="/${tpre#*/}${tsuf#*/}"
else
tmp2="${cpre}${tpre}"
- PREFIX="${donepath}${linepath}${tmp2}"
+ PREFIX="${linepath}${donepath}${tmp2}"
SUFFIX="${tsuf}"
fi
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
prev parent reply other threads:[~2009-01-29 17:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-27 23:54 Greg Klanderman
2009-01-29 16:20 ` Bart Schaefer
2009-01-29 17:51 ` Peter Stephenson [this message]
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=20090129175125.4fd49a32@news01 \
--to=pws@csr.com \
--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).