about summary refs log tree commit diff
path: root/Src/Zle/compresult.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-17 11:17:10 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-17 11:17:10 +0000
commit30a98cc4d6e54f2a5c356579aa60c2af8d344101 (patch)
tree6cc8874b7712a0be1f5a506dee62ca984d53b130 /Src/Zle/compresult.c
parentd85d34d8183a8a45bfb09c4242ef9368860be6d9 (diff)
downloadzsh-30a98cc4d6e54f2a5c356579aa60c2af8d344101.tar.gz
zsh-30a98cc4d6e54f2a5c356579aa60c2af8d344101.tar.xz
zsh-30a98cc4d6e54f2a5c356579aa60c2af8d344101.zip
scrolling in completion lists and menu-selection, version1
Diffstat (limited to 'Src/Zle/compresult.c')
-rw-r--r--Src/Zle/compresult.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index e56110a70..87e1f7278 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -1157,7 +1157,7 @@ skipnolist(Cmatch *p, int showall)
 }
 
 /**/
-mod_export void
+mod_export int
 calclist(int showall)
 {
     Cmgroup g;
@@ -1170,7 +1170,7 @@ calclist(int showall)
     if (listdat.valid && onlyexpl == listdat.onlyexpl &&
 	menuacc == listdat.menuacc && showall == listdat.showall &&
 	lines == listdat.lines && columns == listdat.columns)
-	return;
+	return 0;
 
     for (g = amatches; g; g = g->next) {
 	char **pp = g->ylist;
@@ -1572,11 +1572,16 @@ calclist(int showall)
     listdat.columns = columns;
     listdat.lines = lines;
     listdat.showall = showall;
+
+    return 1;
 }
 
 /**/
-mod_export int asklist(void)
+mod_export int
+asklist(void)
 {
+    int lmax = (complistmax ? (int) mathevali(complistmax) : 0);
+
     /* Set the cursor below the prompt. */
     trashzle();
     showinglist = listshown = 0;
@@ -1586,9 +1591,9 @@ mod_export int asklist(void)
 
     /* Maybe we have to ask if the user wants to see the list. */
     if ((!minfo.cur || !minfo.asked) &&
-	((complistmax > 0 && listdat.nlist >= complistmax) ||
-	 (complistmax < 0 && listdat.nlines <= -complistmax) ||
-	 (!complistmax && listdat.nlines >= lines))) {
+	((lmax > 0 && listdat.nlist >= lmax) ||
+	 (lmax < 0 && listdat.nlines <= -lmax) ||
+	 (!lmax && listdat.nlines >= lines))) {
 	int qup, l;
 
 	zsetterm();
@@ -1599,7 +1604,7 @@ mod_export int asklist(void)
 		     listdat.nlines));
 	qup = ((l + columns - 1) / columns) - 1;
 	fflush(shout);
-	if (getzlequery() != 'y') {
+	if (getzlequery(1) != 'y') {
 	    if (clearflag) {
 		putc('\r', shout);
 		tcmultout(TCUP, TCMULTUP, qup);