From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18479 invoked by alias); 2 Aug 2018 14:10:01 -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: 43231 Received: (qmail 18377 invoked by uid 1010); 2 Aug 2018 14:10:01 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-expgw.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.98.1):SA:0(-2.6/5.0):. Processed in 1.471048 secs); 02 Aug 2018 14:10:01 -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: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: A weird bug of grep completion Date: Thu, 2 Aug 2018 23:09:55 +0900 References: <15e31c7e-4fc4-401a-8320-184f3914e572@Spark> To: zsh-workers@zsh.org In-Reply-To: <15e31c7e-4fc4-401a-8320-184f3914e572@Spark> Message-Id: <9B106BAB-CA6A-454E-AE77-A9F8FC2A4779@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3273) X-Biglobe-Spnum: 56320 > 2018/07/28 11:28, Joseph Lee wrote: >=20 > A weird behavior happened when completing `grep --no-*` arguments. > While typing `--no-group-separator`, which is a GNU only argument, = after another `--no-*`, the cursor stoped in a wrong place and unable to = finish completion. But it works right when `--no-group-separator` goes = ahead. The problem can be reproduced by simple examples shown below, but I don't know how to fix it. % compdef '_arguments : -a-a -a-b -a-c -a-d-e' cmd Then the following work as expected ('' can be replaced by '-' or '-a-' etc.) % cmd % cmd -a-a % cmd -a-a -a-b -a-c % cmd -a-a -a-d-e But this does not work % cmd -a-a -a-b So the problem occurs when exactly two possibilities are remaining for completion and one of the possibilities contains two (or more) hyphens (as in a-d-e) except for the leading '-'. # If -a-d-e is replaced by -a-d-c then behavior changes # (becomes worse, I think). The problem is related with the match-spec "r:|[_-]=3D*" used by _arguments (hard-coded in parse_cadef(), computil.c). For example, the following does not work either: % compdef 'compadd -M "r:|[_-]=3D*" a-a a-b-a' cmd % cmd But I couldn't get exactly why this happens or how to fix this.=