summary refs log tree commit diff
path: root/Src/Zle/zle_tricky.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2002-07-01 08:25:15 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2002-07-01 08:25:15 +0000
commit053629183d8075c5bd122c9767f0b4f8bf8be870 (patch)
tree7285316b73b6f649e1febcebc30be0c4fdfa3e0b /Src/Zle/zle_tricky.c
parent6278159f6dc177bdfd6a18779b081198d47a9a80 (diff)
downloadzsh-053629183d8075c5bd122c9767f0b4f8bf8be870.tar.gz
zsh-053629183d8075c5bd122c9767f0b4f8bf8be870.tar.xz
zsh-053629183d8075c5bd122c9767f0b4f8bf8be870.zip
add new sepcial context -assign-parameter- for completing the parameter in an assignment (17387)
Diffstat (limited to 'Src/Zle/zle_tricky.c')
-rw-r--r--Src/Zle/zle_tricky.c25
1 files changed, 19 insertions, 6 deletions
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;
     }