commit 4ce6610
Hubert Hirtz
·
2021-07-11 10:47:27 +0000 UTC
parent f2be0b9
Do not print empty rows If a message contains a sequence of spaces/tabs that is wider than the terminal, do not print an empty row.
1 files changed,
+4,
-0
+4,
-0
1@@ -113,6 +113,10 @@ func (l *Line) NewLines(width int) []int {
2 // It fits, but there is no more space in the row.
3 x = 0
4 l.newLines = append(l.newLines, sp2.I)
5+ } else if sp1.Split && width < sp2.X-sp1.X {
6+ // Some whitespace occupies a width larger than the terminal's.
7+ x = 0
8+ l.newLines = append(l.newLines, sp1.I)
9 } else if width < sp2.X-sp1.X {
10 // It doesn't fit at all. The word is longer than the width of the
11 // terminal. In this case, no newline is placed before (like in the