diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-28 07:39:08 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-28 07:39:08 +0000 |
commit | b19f915a4f3a986bd48b32e16cda0ea2cb5acbe7 (patch) | |
tree | 250c3cd1866d84c87e50ef691220353eba7db539 /Src/Zle | |
parent | 05d09daba645fc58085af995f6887b5c62d12003 (diff) | |
download | zsh-b19f915a4f3a986bd48b32e16cda0ea2cb5acbe7.tar.gz zsh-b19f915a4f3a986bd48b32e16cda0ea2cb5acbe7.tar.xz zsh-b19f915a4f3a986bd48b32e16cda0ea2cb5acbe7.zip |
avoid wrapping around both horizontally and vertically at the same time (10992)
Diffstat (limited to 'Src/Zle')
-rw-r--r-- | Src/Zle/complist.c | 44 |
1 files changed, 38 insertions, 6 deletions
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) |