GothenburgBitFactory / GothenburgBitFactory/taskwarrior
[TW-12] Hyphenation should factor into minimum width calculations
- Dominant language
- C++
- Stars
- 6.1k
- Forks
- 423
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 11
Description
_Paul Beckingham on 2013-04-02T00:35:12Z says:_
Suppose a report is minimally (without hypenation) 60 characters wide, and the ideal (non-wrapped) width is 100 characters. I can represent this:
```
0-------------------60------------100 columns
<----------------------------------->
maximum width needed by report
<--------------------------->
report expands to fill all
the available space
<-------------------->
minimum width of
terminal for report
to render
<------------------>
minimum width if
hyphenation is
used properly
```
If the Window is 100 columns or more wide, then the report will render in 100 columns, because 100 is the ideal width.
If the Window is 80 columns wide, then the 60-column minimal width is used as a starting point, and the difference of 20 columns is spread between all columns that ideally would use more space, up to their ideal width.
Now if the window is smaller than 60 columns, the report is rendering using 60 columns anyway, and a new warning appears.
What is not currently working is the relatively small difference between the 60 and the smaller width where hyphenation is considered. Hyphenation should only occur on words longer than, say, 2 characters, so that "hello" would be hyphenated like this:
```
he-
ll-
o
```
That's an extreme example, but makes a valid point. The current minimum width for the description column is the longest word within it. Let's say that word is 12 letters long. The difference between the 12 and 3 using extreme hyphenation is 9 columns, so there is an opportunity to fit a report in a window 9 columns narrower. In the typical case this is not a big issue. The larger issue is when a task annotation contains a URL. A URL can be quite long, with no spaces in it.
Contributor guide
Assessment
This issue has not been assessed yet.