From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1585 invoked from network); 2 Sep 2021 20:28:34 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 2 Sep 2021 20:28:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:cc:Reply-To: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=3S6SueOFfMd6Ak/+R6TKjas8yHhmvu4YFU2/qAhydRQ=; b=mHWjwm0fiK8FGBCrDL8za4aZ+0 +PlL1X07TnxW24ySAmwe2erR48xfWAU/oXWoxZ9zU63L41E/YSIDaTwz24APMXeGHiCKE6KKmzKvL 5YfQPjAJmpvEaXNkDEVxSFhVUX9/jujskQ2B0610jn32CwmVkeSmV/n/Cc5Obf0hNrTSWRwQZj0U9 IqfVHLaTlgYZOJPClF7GZ9fkAql8YFxzzdNQG2Pmxs9N2J4F1TZSDaMcxUf1qxeq/3QlGYV2RGn9X 0ChBKmg8xfPNC3HtGJsxC+pIU7/z7H0KeidKfBN0HSOHatcmautHnT5gV2pYkGM7mGu5HfmfzPX5G nAq+7g+Q==; Received: from authenticated user by zero.zsh.org with local id 1mLtK5-0003H6-OW; Thu, 02 Sep 2021 20:28:33 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mLt1B-000Omq-Nd; Thu, 02 Sep 2021 20:09:01 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94.2) (envelope-from ) id 1mLt18-000AFI-W1; Thu, 02 Sep 2021 22:08:59 +0200 cc: Zsh Users In-reply-to: From: Oliver Kiddle References: To: Marlon Richert Subject: Re: Completion: How to show description for current option? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <39386.1630613338.1@hydra> Date: Thu, 02 Sep 2021 22:08:58 +0200 Message-ID: <39387-1630613338.989690@_LKB.nzf7.4sbx> X-Seq: 27072 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 31 Aug, Marlon Richert wrote: > If I type > > % git switch -c^D > > then completion shows only > -c This can be reproduced with just _arguments -s '-c[desc]' The code relevant to this is this part of _arguments: 346 if comparguments -O next direct odirect equal; then 347 opts=yes 348 _tags options 349 elif [[ $? -eq 2 ]]; then 350 compadd -Q - "${PREFIX}${SUFFIX}" 351 return 0 The comparguments -O has decided that there are no possible completion matches which is arguably true because -c is already there and, because we passed -s to _arguments, it is now trying to complete further options after -c. It looks like there is special handling for this case that has only considered actual completion because it is doing a plain compadd without descriptions. A similar case would be _arguments -s '-c[desc]' -d and -dc^D That prints 'no arguments' A fix would need to be done within the C code for comparguments -O and it'd probably be hard to do without breaking it more than fixing it. Oliver