about summary refs log tree commit diff
path: root/Src/Zle/zle_tricky.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-08-09 22:08:38 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-08-09 22:08:38 +0000
commit2983ed3fb3301d1808ae04a3a04389e3cd3fde8a (patch)
treec9a1f5eecc55a14ca9949c6fb07a4c1c2d2bfc09 /Src/Zle/zle_tricky.c
parent9c33cf443419b74c5769279f4f1043465b62f64b (diff)
downloadzsh-2983ed3fb3301d1808ae04a3a04389e3cd3fde8a.tar.gz
zsh-2983ed3fb3301d1808ae04a3a04389e3cd3fde8a.tar.xz
zsh-2983ed3fb3301d1808ae04a3a04389e3cd3fde8a.zip
22594: Attempt to fix some off-by-one errors for completion lists
that exactly fit the display width
Diffstat (limited to 'Src/Zle/zle_tricky.c')
-rw-r--r--Src/Zle/zle_tricky.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 4b7d3126d..768d7e34f 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2074,6 +2074,7 @@ printfmt(char *fmt, int n, int dopr, int doesc)
 
     for (; *p; p++) {
 	/* Handle the `%' stuff (%% == %, %n == <number of matches>). */
+	/* TODO: we need to use wcwidth() to count cc */
 	if (doesc && *p == '%') {
 	    if (*++p) {
 		m = 0;
@@ -2174,7 +2175,7 @@ printfmt(char *fmt, int n, int dopr, int doesc)
 		putc(' ', shout);
 	}
     }
-    return l + (cc / columns);
+    return l + ((cc-1) / columns);
 }
 
 /* This is used to print expansions. */