about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-28 07:39:08 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-28 07:39:08 +0000
commitb19f915a4f3a986bd48b32e16cda0ea2cb5acbe7 (patch)
tree250c3cd1866d84c87e50ef691220353eba7db539
parent05d09daba645fc58085af995f6887b5c62d12003 (diff)
downloadzsh-b19f915a4f3a986bd48b32e16cda0ea2cb5acbe7.tar.gz
zsh-b19f915a4f3a986bd48b32e16cda0ea2cb5acbe7.tar.xz
zsh-b19f915a4f3a986bd48b32e16cda0ea2cb5acbe7.zip
avoid wrapping around both horizontally and vertically at the same time (10992)
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/complist.c44
2 files changed, 43 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 6849bbe3d..6be546983 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-04-28  Sven Wischnowsky  <wischnow@informatik.hu-berlin.de>
+
+	* 10992: Src/Zle/complist.c: avoid wrapping around both
+ 	horizontally and vertically at the same time
+	
 2000-04-27  Bart Schaefer  <schaefer@brasslantern.com>
 
 	* Tanaka Akira: 10980: Completion for enscript.
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 61edd216c..527cd9825 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1809,12 +1809,23 @@ domenuselect(Hookdef dummy, Chdata dat)
 		   cmd == Th(z_downlineorhistory) ||
 		   cmd == Th(z_downlineorsearch) ||
 		   cmd == Th(z_vidownlineorhistory)) {
+	    int omline;
+	    Cmatch **op;
+
 	    wrap = 0;
 
 	down:
 
+	    omline = mline;
+	    op = p;
+
 	    do {
 		if (mline == mlines - 1) {
+		    if (wrap & 2) {
+			mline = omline; 
+			p = op;
+			break;
+		    }
 		    p -= mline * mcols;
 		    mline = 0;
 		    wrap |= 1;
@@ -1832,12 +1843,23 @@ domenuselect(Hookdef dummy, Chdata dat)
 		   cmd == Th(z_uplineorhistory) ||
 		   cmd == Th(z_uplineorsearch) ||
 		   cmd == Th(z_viuplineorhistory)) {
+	    int omline;
+	    Cmatch **op;
+
 	    wrap = 0;
 
 	up:
 
+	    omline = mline;
+	    op = p;
+
 	    do {
 		if (!mline) {
+		    if (wrap & 2) {
+			mline = omline; 
+			p = op;
+			break;
+		    }
 		    mline = mlines - 1;
 		    p += mline * mcols;
 		    wrap |= 1;
@@ -1948,17 +1970,22 @@ domenuselect(Hookdef dummy, Chdata dat)
 	    p = lp;
 	} else if (cmd == Th(z_forwardchar) || cmd == Th(z_viforwardchar)) {
 	    int omcol;
-	    Cmatch *op;
+	    Cmatch **op;
 
 	    wrap = 0;
 
 	right:
 
 	    omcol = mcol;
-	    op = *p;
+	    op = p;
 
 	    do {
 		if (mcol == mcols - 1) {
+		    if (wrap & 1) {
+			p = op;
+			mcol = omcol;
+			break;
+		    }
 		    p -= mcol;
 		    mcol = 0;
 		    wrap |= 2;
@@ -1966,24 +1993,29 @@ domenuselect(Hookdef dummy, Chdata dat)
 		    mcol++;
 		    p++;
 		}
-	    } while (!*p || (mcol != omcol && *p == op));
+	    } while (!*p || (mcol != omcol && *p == *op));
 	    wishcol = mcol;
 
 	    if (wrap == 2)
 		goto down;
 	} else if (cmd == Th(z_backwardchar) || cmd == Th(z_vibackwardchar)) {
 	    int omcol;
-	    Cmatch *op;
+	    Cmatch **op;
 
 	    wrap = 0;
 
 	left:
 
 	    omcol = mcol;
-	    op = *p;
+	    op = p;
 
 	    do {
 		if (!mcol) {
+		    if (wrap & 1) {
+			p = op;
+			mcol = omcol;
+			break;
+		    }
 		    mcol = mcols - 1;
 		    p += mcol;
 		    wrap |= 2;
@@ -1991,7 +2023,7 @@ domenuselect(Hookdef dummy, Chdata dat)
 		    mcol--;
 		    p--;
 		}
-	    } while (!*p || (mcol != omcol && *p == op));
+	    } while (!*p || (mcol != omcol && *p == *op));
 	    wishcol = mcol;
 
 	    if (wrap == 2)