Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Buglet in zsh perforce completion function
- X-seq: zsh-workers 23527
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: Buglet in zsh perforce completion function
- Date: Tue, 05 Jun 2007 19:12:33 +0100
- Cc: Ken Williams <ken.williams@xxxxxxxxxxx>
- In-reply-to: <C28AFFCD.FC29%ken.williams@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <C28AFFCD.FC29%ken.williams@xxxxxxxxxxx>
I got this bug report...
Ken Williams wrote:
> I recently switched to zsh so that I could use your fantastic _perforce
> completion function. =) I found a small bug in it that I'm not sure how to
> rectify, but hopefully you will.
>
> When I'm completing a 'p4 diff -se' command, hitting <tab> can erase part of
> the argument I'm typing, which is a drag if it's a long one.
>
> For example, here's a sequence I type:
>
> p4 diff -se data/w
>
> Type <tab>, completed to:
> p4 diff -se data/workflow/
>
> Type <tab> again, erased to:
> p4 diff -se data
>
> Thereafter, if I bounce on the <tab> key it toggles between adding &
> subtracting a slash after the "data" word.
Although I don't get quite the same behaviour (probably due to options),
I can see the / being removed and put back and no completion in the
directory being added. This boils down to a bug with the following code:
_tst1() {
local dir=${PREFIX%%[^/]#}
# The details of this don't matter much, only
# the fact that it adds a completion with ... after the
# directory.
compadd -J subdirs -p $dir -W $dir ...
}
_tst() { _alternative "files:file:_path_files" "dots:dots:_tst1"; }
compdef _tst tst
Now completing after "tst" exhibits the same symptoms. I hadn't noticed
because it's suppressed by some option I'm using, I think to do with
tag grouping (but simply putting the subdirs in another group doesn't
work, since that's what I've done in _tst1).
Before I simply try to work round this, does anyone have the first
clue what might be going on in the completion system to cause this?
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview
Messages sorted by:
Reverse Date,
Date,
Thread,
Author