summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-25 12:19:45 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-25 12:19:45 +0000
commitd3c918b863d4580f06b378fd5424346c6e8e679d (patch)
tree575220ac6265fb836b728311985ad5886a6d45ce /Src
parent6e99acad52e4c01aff6d105ec067170226ccbc8b (diff)
downloadzsh-d3c918b863d4580f06b378fd5424346c6e8e679d.tar.gz
zsh-d3c918b863d4580f06b378fd5424346c6e8e679d.tar.xz
zsh-d3c918b863d4580f06b378fd5424346c6e8e679d.zip
re-calculate number of line with mark when needed; make default prompts more consistent (10916)
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/complist.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 48c216cf8..d0dd90bec 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1594,6 +1594,20 @@ domenuselect(Hookdef dummy, Chdata dat)
     mlines = 999999;
     mlbeg = 0;
     for (;;) {
+	if (mline < 0) {
+	    int x, y;
+	    Cmatch **p = mtab;
+
+	    for (y = 0; y < mlines; y++) {
+		for (x = mcols; x; x--, p++)
+		    if (*p && **p && mselect == (**p)->gnum)
+			break;
+		if (x)
+		    break;
+	    }
+	    if (y < mlines)
+		mline = y;
+	}
 	space = lines - nlnct - mhasstat;
 	while (mline < mlbeg)
 	    if ((mlbeg -= step) < 0)
@@ -1999,12 +2013,14 @@ domenuselect(Hookdef dummy, Chdata dat)
 	    do_menucmp(0);
 	    mselect = (*(minfo.cur))->gnum;
 	    setwish = 1;
+	    mline = -1;
 	    continue;
 	} else if (cmd == Th(z_reversemenucomplete) ||
 		   !strcmp(cmd->nam, "reverse-menu-complete")) {
 	    reversemenucomplete(zlenoargs);
 	    mselect = (*(minfo.cur))->gnum;
 	    setwish = 1;
+	    mline = -1;
 	    continue;
 	} else {
 	    ungetkeycmd();