Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] git checkout completion shows duplicated branch names



Bart Schaefer wrote on Mon, 24 Sep 2018 17:24 -0700:
> On Mon, Sep 24, 2018 at 11:00 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author