8bf187f35b
The previous logic conflated some things... in this block: - j: input characters rendered so far - nc: number of characters in the line - col: columns rendered so far - hw: column width ((h)ard (w)idth?) Comparing j to hw or col to nc are naturally wrong, as col and hw are limits on their respective counters and nc is already brought down to hw if the input line should be truncated to start with. Right now, we end up easily truncating lines with tabs in them as we count each tab for $tabwidth lines in the input line, but we really should only be accounting for them in the column count. The problem is most easily demonstrated by the two input files added for the tests, the two tabbed lines lose at least a word or two even though there's plenty of space left in the row for each side. Reviewed by: bapt, pstef Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D37676 |
||
---|---|---|
.. | ||
Bflag_C.out | ||
Bflag_D.out | ||
Bflag_F.out | ||
diff_test.sh | ||
functionname_c.in | ||
functionname_c.out | ||
functionname_objcclassm.in | ||
functionname_objcclassm.out | ||
functionname_objcm.in | ||
functionname_objcm.out | ||
functionname.in | ||
group-format.out | ||
header_ns.out | ||
header.out | ||
ifdef.out | ||
input1.in | ||
input2.in | ||
input_c1.in | ||
input_c2.in | ||
Makefile | ||
Makefile.depend | ||
side_by_side_tabbed_a.in | ||
side_by_side_tabbed_b.in | ||
simple_b.out | ||
simple_e.out | ||
simple_i.out | ||
simple_n.out | ||
simple_p.out | ||
simple_u.out | ||
simple_w.out | ||
simple.out | ||
strip_o.out | ||
unified_9999.out | ||
unified_c9999.out | ||
unified_p.out |