From: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: [PATCH] fix completion of parameter names for ${<TAB> and ${(a)<TAB>
Date: Sat, 30 Oct 2021 15:46:48 +0900 [thread overview]
Message-ID: <DCDED98D-8CF9-4DD3-8CAD-2E82F8E1FBD4@kba.biglobe.ne.jp> (raw)
With current git master, nothing is offered by
${<TAB>
${(a)<TAB>
although ${a<TAB> 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
${<TAB> works if '>=' is replaced by '>' at line 1192 of compcore.c
(I think this is a simple off-by-one error). But ${(a)<TAB> 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) 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;
/* Ignore the possible (...) flags. */
- tb = ++b, br++;
- if ((qstring ? skipparens('(', ')', &tb) :
- skipparens(Inpar, Outpar, &tb)) > 0 || tb - s >= 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 = 2;
return NULL;
}
- if ((qstring ? '(' : Inpar) == *b) {
- /*
- * We are inside the braces but on the opening paren.
- * There is nothing useful to complete here?
- */
- return NULL;
- } else
- b = tb; /* Skip over the flags */
for (tb = p - 1; tb > s && *tb != Outbrace && *tb != Inbrace; tb--);
if (tb > s && *tb == Inbrace && (tb[-1] == String || *tb == Qstring))
next reply other threads:[~2021-10-30 6:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-30 6:46 Jun. T [this message]
2021-11-01 4:24 ` Bart Schaefer
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=DCDED98D-8CF9-4DD3-8CAD-2E82F8E1FBD4@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).