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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30417 invoked from network); 30 Oct 2021 06:47:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Oct 2021 06:47:39 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1635576459; b=MBYOadCONKtpKyAvcX34wbp4X/H6t31FPnM2EsEgUTqLkndLc14Grn8yCbo8v3PH9t/eMYFrIT qAh+KU//+F1S2IGm7Q2+rAvr7kswdFfbPQ33i6uICMZfYoU5AB3XPafPRl+E/7wq9uVTIoQT8T plvGv/UTI2DeIFviMxG5tgLFQucKABGtFZNoIkksWNSlJAftGOkAdO8QswIGb3Qk8a69DAWVU8 XSUsrjxQk1tlyvJuEUq3ERq+x+9eIgdEIQpyiiZYZS1GU7Nrc+0sM3WLi3MIWBEKLuIpkiV6te Dl7/wR4GfoF+dkJCdr6qgfHwfVFbBZiWxa8jTBxOdOYQQg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd01004-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.20; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1635576459; bh=A671AeqaA18uqxfaWD64Q+VGZbd2LhaesVFusDchGjg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:Date:Message-ID:Subject:MIME-Version: Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=nNpjnqkaNFRld8qdFfkoQwRgAdMZg2XcOpnkHerZehL/6FsXrRyA7gdaOKxCu4+qFwFwz+t8JT PwAFJHb2LMJB9HfmMT6H1m4HBGC1RZgJ/iz8CzNwICed8UD/ZoJewskYcFPtBJ6wmXp7d/I9yL /GUKJIGfNWbCnyP8qZbIwzuItlZvneiGnUUduclcR3gz4gINGNmUVNh5GeLf+MZ7iA91mvwq3+ /PGhVF6avL1uzAonfrV5l8AEXtUsgKWccRz49mEf9yJaSVaxNnJKVANe6YeXhqZO9cgRd/oWnO d+21/h+Wvxzl8d9rbOUAYqGl95wu0ewZhhqMdm3qbE4+wg==; 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:To:Date:Message-Id:Subject: Mime-Version:Content-Transfer-Encoding:Content-Type:From:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=9E7M9BSQdx5RDeBDxmFp/Z571Fo80Puxh4g3Svqrj3w=; b=cWvLu9fWFzXkxb1a/T+KRx2JB2 1m5bdnvePl+F72nTA4lYKLomqWboD8RJ6h8EoBbro9xu1HBTQDkszqiUnr4l1vDIbG1dK+DyTMQQg zEfJHHg/5vUx5eKcqHy8rjOaQiLS+bDJQsi2WHqbXNLnVsOBl2J2ugcu/iMPKQe9lZIEeZJvYR/xb 7Tg6gMwbWlWskRS1ZeY7Lup40R0UhFi5UVMch/YEzNASzhgxW1TRMr2XY1dJ1n2OofF20Ov+2E6oX yLwjPAmqAwsNujH3mii0H6hUGKu8PuV34f8YS+1iao88Sd770FJwarTpv8gCDU/+n2oVtZYF1BBss OjIk5uXA==; Received: from authenticated user by zero.zsh.org with local id 1mgi9Q-00043t-LF; Sat, 30 Oct 2021 06:47:36 +0000 Authentication-Results: zsh.org; iprev=pass (snd01004-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.20; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd01004-bg.im.kddi.ne.jp ([27.86.113.20]:6115 helo=dfmta1018.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mgi8n-0003kh-1P; Sat, 30 Oct 2021 06:46:59 +0000 Received: from mail.biglobe.ne.jp by omta1018.biglobe.ne.jp with ESMTP id <20211030064650077.PANK.62238.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Sat, 30 Oct 2021 15:46:50 +0900 From: "Jun. T" Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: [PATCH] fix completion of parameter names for ${ and ${(a) Message-Id: Date: Sat, 30 Oct 2021 15:46:48 +0900 To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3445.104.21) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 49535 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: With current git master, nothing is offered by ${ ${(a) although ${a offers parameter names starting with 'a'. git-bisect showed that the problem started with commit d0e071c5f0bf6a879756f72e1f0d0ae6952a4b49 Author: Bart Schaefer Date: Sat May 15 13:40:37 2021 -0700 48790: COMPLETE_IN_WORD inside brace-param ${ works if '>=3D' is replaced by '>' at line 1192 of compcore.c (I think this is a simple off-by-one error). But ${(a) still doesn't work. In the patch below I removed the lines 1203-1209 (and the use of the variable 'tb' that is now redundant) to fix this problem. The original problem (worker/48788=E2=81=A9) that is fixed = by the above commit is not affected by this patch. I _hope_ there are no bad side effects. diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 63136854e..9ec48f367 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -1187,9 +1187,9 @@ check_param(char *s, int set, int test) return NULL; =20 /* Ignore the possible (...) flags. */ - tb =3D ++b, br++; - if ((qstring ? skipparens('(', ')', &tb) : - skipparens(Inpar, Outpar, &tb)) > 0 || tb - s >=3D = offs) { + b++, br++; + if ((qstring ? skipparens('(', ')', &b) : + skipparens(Inpar, Outpar, &b)) > 0 || b - s > offs) { /* * We are still within the parameter flags. There's no * point trying to do anything clever here with @@ -1200,14 +1200,6 @@ check_param(char *s, int set, int test) ispar =3D 2; return NULL; } - if ((qstring ? '(' : Inpar) =3D=3D *b) { - /* - * We are inside the braces but on the opening paren. - * There is nothing useful to complete here? - */ - return NULL; - } else - b =3D tb; /* Skip over the flags */ =20 for (tb =3D p - 1; tb > s && *tb !=3D Outbrace && *tb !=3D = Inbrace; tb--); if (tb > s && *tb =3D=3D Inbrace && (tb[-1] =3D=3D String || = *tb =3D=3D Qstring))