zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Cc: Ken Williams <ken.williams@thomson.com>
Subject: Re: Buglet in zsh perforce completion function
Date: Tue, 05 Jun 2007 19:12:33 +0100	[thread overview]
Message-ID: <200706051812.l55ICXMM004955@news01.csr.com> (raw)
In-Reply-To: <C28AFFCD.FC29%ken.williams@thomson.com>

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@csr.com>                  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


       reply	other threads:[~2007-06-05 18:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <C28AFFCD.FC29%ken.williams@thomson.com>
2007-06-05 18:12 ` Peter Stephenson [this message]
2007-06-10  1:59   ` Bart Schaefer
2007-06-10  8:19     ` Bart Schaefer
2007-06-11  9:03       ` Peter Stephenson

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=200706051812.l55ICXMM004955@news01.csr.com \
    --to=pws@csr.com \
    --cc=ken.williams@thomson.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).