diff options
Diffstat (limited to 'Src')
-rw-r--r-- | Src/Zle/compcore.c | 2 | ||||
-rw-r--r-- | Src/Zle/zle_tricky.c | 25 | ||||
-rw-r--r-- | Src/zsh.h | 2 |
3 files changed, 23 insertions, 6 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index fbf1339f1..e0aef2864 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -553,6 +553,8 @@ callcompfunc(char *s, char *fn) compparameter = compredirect = ""; if (ispar) compcontext = (ispar == 2 ? "brace_parameter" : "parameter"); + else if (linwhat == IN_PAR) + compcontext = "assign_parameter"; else if (linwhat == IN_MATH) { if (insubscr) { compcontext = "subscript"; diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index a007be3e9..56518f514 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -1256,12 +1256,25 @@ get_comp_string(void) insubscr = 2; else insubscr = 1; - } else if (*s == '=' && cs > wb + (s - tt)) { - s++; - wb += s - tt; - t0 = STRING; - s = ztrdup(s); - inwhat = IN_ENV; + } else if (*s == '=') { + if (cs > wb + (s - tt)) { + s++; + wb += s - tt; + s = ztrdup(s); + inwhat = IN_ENV; + } else { + char *p = s; + + if (p[-1] == '+') + p--; + sav = *p; + *p = '\0'; + inwhat = IN_PAR; + s = ztrdup(tt); + *p = sav; + we = wb + p - tt; + } + t0 = STRING; } lincmd = 1; } diff --git a/Src/zsh.h b/Src/zsh.h index 504fd1396..1697e26a0 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -1318,6 +1318,8 @@ struct histent { #define IN_COND 3 /* In a parameter assignment (e.g. `foo=bar'). */ #define IN_ENV 4 +/* In a parameter name in an assignment. */ +#define IN_PAR 5 /******************************/ |