zsh-workers
 help / color / mirror / code / Atom feed
From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: A weird bug of grep completion
Date: Thu, 16 Aug 2018 17:20:55 +0900	[thread overview]
Message-ID: <01FDC3E8-261A-458B-8704-405FEA9EC65E@kba.biglobe.ne.jp> (raw)
In-Reply-To: <9B106BAB-CA6A-454E-AE77-A9F8FC2A4779@kba.biglobe.ne.jp>

Is there anyone looking into this problem?

A minimal example to reproduce the problem is:
    % _cmd() { compadd -M 'r:|[_-]=*' a-b a-c-d }       # [1]
    % compdef _cmd cmd
    % cmd <TAB>
The cursor is misplaced after the first TAB.

If a-c-d is replaced by a-c-b, the problem becomes worse:
    % _cmd() { compadd -M 'r:|[_-]=*' a-b a-c-b }       # [2]
    % cmd <TAB>
Only a-b is completed in this case.
The following behaves similarly (only a-b is completed):
    % _cmd() { compadd -M 'r:|[_-]=*' a-b a-c-b a-d-b } # [3]

But the followings are OK:
    % _cmd() { compadd -M 'r:|[_-]=*' a-c-b a-b }       # [4]
or
    % _cmd() { compadd -M 'r:|[_-]=*' a-b a-e a-c-b }   # [5]

[2] and [4] differ only in the order 'a-b' and 'a-c-b' are passed
to compadd. I guess the function join_clines() (compmatch.c) is
most suspicious but not sure.
Anyway the code is too complicated for me to debug.


  reply	other threads:[~2018-08-16  8:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-28  2:28 Joseph Lee
2018-07-28  2:34 ` Joey Pabalinas
2018-07-28  7:54   ` Daniel Shahaf
2018-07-30  3:39     ` Joseph Lee
2018-08-02 14:09 ` Jun T.
2018-08-16  8:20   ` Jun T [this message]
2018-08-16  9:02     ` 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=01FDC3E8-261A-458B-8704-405FEA9EC65E@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --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).