about summary refs log tree commit diff
path: root/Src/Zle/zle_tricky.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:07:38 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:07:38 +0000
commitf13624e0f8a3c28c90aa0ce8ee36b639a491e4a9 (patch)
tree7ebc57c7b2ceed481e23f598011dc88d159c9178 /Src/Zle/zle_tricky.c
parenta61dc2074ae6cd00f1c166dc0102c491db056060 (diff)
downloadzsh-f13624e0f8a3c28c90aa0ce8ee36b639a491e4a9.tar.gz
zsh-f13624e0f8a3c28c90aa0ce8ee36b639a491e4a9.tar.xz
zsh-f13624e0f8a3c28c90aa0ce8ee36b639a491e4a9.zip
zsh-3.1.5-pws-2 zsh-3.1.5-pws-2
Diffstat (limited to 'Src/Zle/zle_tricky.c')
-rw-r--r--Src/Zle/zle_tricky.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 9ffef3b80..a8998739c 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2945,7 +2945,7 @@ docompletion(char *s, int lst, int incmd)
 	ainfo = fainfo = NULL;
 
 	/* Make sure we have the completion list and compctl. */
-	if (makecomplist(s, incmd)) {
+	if (makecomplist(s, incmd, lst)) {
 	    /* Error condition: feeeeeeeeeeeeep(). */
 	    feep();
 	    goto compend;
@@ -3029,7 +3029,7 @@ static unsigned long ccont;
 
 /**/
 static int
-makecomplist(char *s, int incmd)
+makecomplist(char *s, int incmd, int lst)
 {
     struct cmlist ms;
     Cmlist m = cmatcher;
@@ -3062,7 +3062,7 @@ makecomplist(char *s, int incmd)
 	ccused = newlinklist();
 	ccstack = newlinklist();
 
-	makecomplistglobal(s, incmd);
+	makecomplistglobal(s, incmd, lst);
 
 	endcmgroup(NULL);
 
@@ -3098,12 +3098,14 @@ makecomplist(char *s, int incmd)
 
 /**/
 static void
-makecomplistglobal(char *os, int incmd)
+makecomplistglobal(char *os, int incmd, int lst)
 {
     Compctl cc;
     char *s;
 
-    if (inwhat == IN_ENV)
+    if (lst == COMP_WIDGET) {
+	cc = compwidget->u.cc;
+    } else if (inwhat == IN_ENV)
         /* Default completion for parameter values. */
         cc = &cc_default;
     else if (inwhat == IN_MATH) {
@@ -4413,7 +4415,8 @@ get_user_var(char *nam)
     } else {
 	/* Otherwise it should be a parameter name. */
 	char **arr = NULL, *val;
-	if (!(arr = getaparam(nam)) && (val = getsparam(nam))) {
+	if (!(arr = getaparam(nam)) && !(arr = gethparam(nam)) &&
+	    (val = getsparam(nam))) {
 	    arr = (char **)ncalloc(2*sizeof(char *));
 	    arr[0] = val;
 	    arr[1] = NULL;
@@ -5026,6 +5029,7 @@ do_single(Cmatch m)
 		else {
 		    p = (char *) ncalloc(strlen(ppre) + strlen(str) +
 					 strlen(psuf) + 1);
+		    sprintf(p, "%s%s%s", ppre, str, psuf);
 		}
 		parsestr(p);
 		if (ic)