From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27701 invoked by alias); 16 Aug 2018 08:57:09 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43304 Received: (qmail 19367 invoked by uid 1010); 16 Aug 2018 08:57:09 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-mqugw.biglobe.ne.jp by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(133.208.100.2):SA:0(-2.6/5.0):. Processed in 2.591873 secs); 16 Aug 2018 08:57:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: takimoto-j@kba.biglobe.ne.jp X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Biglobe-Sender: From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: A weird bug of grep completion Date: Thu, 16 Aug 2018 17:20:55 +0900 References: <15e31c7e-4fc4-401a-8320-184f3914e572@Spark> <9B106BAB-CA6A-454E-AE77-A9F8FC2A4779@kba.biglobe.ne.jp> To: zsh-workers@zsh.org In-Reply-To: <9B106BAB-CA6A-454E-AE77-A9F8FC2A4779@kba.biglobe.ne.jp> Message-Id: <01FDC3E8-261A-458B-8704-405FEA9EC65E@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3273) X-Biglobe-Spnum: 53562 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 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 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.