about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-10-11 10:57:40 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-10-11 10:57:40 +0000
commit5d8adbee0753795e7903b40847e17c879766dbf7 (patch)
tree5aad6d5536a3d9d0d0131cee2ba497bb5f8e7b3f /Src
parente1fb97ee440f41014bb621f588ac04011280ddbe (diff)
downloadzsh-5d8adbee0753795e7903b40847e17c879766dbf7.tar.gz
zsh-5d8adbee0753795e7903b40847e17c879766dbf7.tar.xz
zsh-5d8adbee0753795e7903b40847e17c879766dbf7.zip
make user defined completion widgets leave menu selection without accepting the currently selected match (12959)
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/compcore.c8
-rw-r--r--Src/Zle/complist.c10
2 files changed, 13 insertions, 5 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 0c9fcd676..6941dbfe2 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -524,14 +524,16 @@ after_complete(Hookdef dummy, int *dat)
 	    dat[1] = 0;
 	    menucmp = menuacc = 0;
 	    minfo.cur = NULL;
-	    if (ret == 2) {
+	    if (ret >= 2) {
 		fixsuffix();
 		cs = 0;
 		foredel(ll);
 		inststr(origline);
 		cs = origcs;
-		clearlist = 1;
-		invalidatelist();
+		if (ret == 2) {
+		    clearlist = 1;
+		    invalidatelist();
+		}
 	    }
 	}
     }
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 7c2fdfe57..a7dbf6412 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -2237,7 +2237,11 @@ domenuselect(Hookdef dummy, Chdata dat)
 	    continue;
 	} else {
 	    ungetkeycmd();
-	    acc = 1;
+	    if (cmd->widget && (cmd->widget->flags & WIDGET_NCOMP)) {
+		acc = 0;
+		broken = 2;
+	    } else
+		acc = 1;
 	    break;
 	}
 	do_single(**p);
@@ -2260,6 +2264,7 @@ domenuselect(Hookdef dummy, Chdata dat)
 	menucmp = 2;
 	showinglist = -2;
 	minfo.asked = 0;
+	zrefresh();
     }
     if (!noselect && (!dat || acc)) {
 	showinglist = -2;
@@ -2271,7 +2276,8 @@ domenuselect(Hookdef dummy, Chdata dat)
     mlbeg = -1;
     fdat = NULL;
 
-    return ((dat && !broken) ? (acc ? 1 : 2) : (!noselect ^ acc));
+    return (broken == 2 ? 3 :
+	    ((dat && !broken) ? (acc ? 1 : 2) : (!noselect ^ acc)));
 }
 
 /* The widget function. */