summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/complist.c8
-rw-r--r--Src/Zle/zle_tricky.c7
2 files changed, 12 insertions, 3 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 8f1a24385..c90af8480 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1055,8 +1055,12 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop)
if (stat && n)
mfirstl = -1;
- mlprinted = l + (cc ? ((cc-1) / columns) : 0);
- return mlprinted;
+ /*
+ * *Not* subtracting 1 from cc at this point appears to be
+ * correct. C.f. printfmt in zle_tricky.c.
+ */
+ mlprinted = l + (cc / columns);
+ return mlprinted;
}
/* This is like zputs(), but allows scrolling. */
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 768d7e34f..fbe04ca5d 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2175,7 +2175,12 @@ printfmt(char *fmt, int n, int dopr, int doesc)
putc(' ', shout);
}
}
- return l + ((cc-1) / columns);
+ /*
+ * Experiments suggest that at this point not subtracting 1 from
+ * cc is correct, i.e. if just misses wrapping we still add 1.
+ * (Why?)
+ */
+ return l + (cc / columns);
}
/* This is used to print expansions. */