zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Cc: "Marc Cornellà" <marc.cornella@live.com>
Subject: Re: [BUG] git checkout completion shows duplicated branch names
Date: Tue, 25 Sep 2018 16:50:43 +0000	[thread overview]
Message-ID: <1537894243.3442984.1520252632.2EB83DDE@webmail.messagingengine.com> (raw)
In-Reply-To: <CAH+w=7ZJOm+h-NPACWbQcLrLigBe_QZm+7zGaUw2zSWS=Twm4g@mail.gmail.com>

Bart Schaefer wrote on Mon, 24 Sep 2018 17:24 -0700:
> On Mon, Sep 24, 2018 at 11:00 AM, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> >
> > Can anyone think of a reason to consider matches different if their display
> > strings both exist, and differ; or if one of them has a display string and one
> > does not?
> 
> Perhaps not  in the latter case, but if the items really should be in
> two different groups (and the groups are going to be displayed
> separately) or the display string is providing info to the user that
> explains why one might wish to select that completion, then it's
> potentially helpful to include it both times.

I tried with:

_g() { local a=( foo:FOO bar:BAR ) b=( foo:1 bar:2 ) expl ; _describe -t lorem lorem a; _describe -t ipsum ipsum b; }

_h() { local a=( FOO BAR ) ; compadd -V v -ld a foo bar ; compadd -J j -ld a foo bar }

and in both cases, "FOO" showed twice, and 'g fo<TAB>' (respectively 'h
fo<TAB>') did not treat the completion as ambiguous.  I conclude that
the relaxation of matcheq() does not prevent duplicate matches from
being listed twice.

However, I can't confirm that conclusion by code inspection.  I went
through the callsites of matcheq() but they are not terribly well-documented.
Does anyone know what permmatches() does?  What about  makearray()?  The
docstrings aren't that clear.

Should I test any other cases?

Cheers,

Daniel

  reply	other threads:[~2018-09-25 16:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 14:51 Marc Cornellà
2018-09-24 16:04 ` Daniel Shahaf
2018-09-24 18:00   ` Daniel Shahaf
2018-09-25  0:24     ` Bart Schaefer
2018-09-25 16:50       ` Daniel Shahaf [this message]
2018-09-25  0:46     ` Oliver Kiddle
2018-09-25 16:43       ` Daniel Shahaf
2018-09-25 17:15         ` Bart Schaefer
2018-09-25 17:28           ` Daniel Shahaf

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=1537894243.3442984.1520252632.2EB83DDE@webmail.messagingengine.com \
    --to=d.s@daniel.shahaf.name \
    --cc=marc.cornella@live.com \
    --cc=zsh-workers@zsh.org \
    /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).