From 053629183d8075c5bd122c9767f0b4f8bf8be870 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 1 Jul 2002 08:25:15 +0000 Subject: add new sepcial context -assign-parameter- for completing the parameter in an assignment (17387) --- Src/Zle/zle_tricky.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'Src/Zle/zle_tricky.c') 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; } -- cgit 1.4.1