From b067ab08d65c7ec9a48f5527076bf0f9b17e622c Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Mon, 1 Nov 2021 23:33:57 +0900 Subject: 49535: fix completion for ${ and ${(a) --- Src/Zle/compcore.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'Src/Zle') diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 2f3d53834..c6deff756 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)) -- cgit 1.4.1