diff options
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | src/preproc/tbl/table.cpp | 2 | ||||
-rw-r--r-- | src/preproc/tbl/tbl.am | 1 | ||||
-rwxr-xr-x | src/preproc/tbl/tests/check-horizontal-line-length.sh | 8 | ||||
-rwxr-xr-x | src/preproc/tbl/tests/check-line-intersections.sh | 2 | ||||
-rwxr-xr-x | src/preproc/tbl/tests/check-vertical-line-length.sh | 2 |
6 files changed, 23 insertions, 7 deletions
@@ -11,6 +11,21 @@ 2023-02-02 G. Branden Robinson <g.branden.robinson@gmail.com> + * src/preproc/tbl/table.cpp (table::compute_column_positions): + If a table has "left separation" (it is boxed, or has a vertical + rule on the left-hand side), increase the first column's start + register value by 1n, for symmetry with the right-hand size. + + * src/preproc/tbl/tests/check-horizontal-line-length.sh: + * src/preproc/tbl/tests/check-line-intersections.sh: + * src/preproc/tbl/tests/check-vertical-line-length.sh: Update + output expectations. + + * src/preproc/tbl/tbl.am (tbl_XFAIL_TESTS): Remove now-passing + test. + +2023-02-02 G. Branden Robinson <g.branden.robinson@gmail.com> + * src/preproc/tbl/table.cpp (table::compute_total_separation): Trivially refactor; rename loop indices so it's obvious which dimension of a matrix they're referring to. diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp index 126f1c2d2..0d1b13186 100644 --- a/src/preproc/tbl/table.cpp +++ b/src/preproc/tbl/table.cpp @@ -2287,6 +2287,8 @@ void table::compute_column_positions() printfs(".nr %1 %2*\\n[" SEPARATION_FACTOR_REG "]\n", column_start_reg(0), as_string(left_separation)); + if (left_separation) + printfs(".if n .nr %1 +1n\n", column_start_reg(0)); int i; for (i = 1;; i++) { printfs(".nr %1 \\n[%2]+\\n[%3]\n", diff --git a/src/preproc/tbl/tbl.am b/src/preproc/tbl/tbl.am index 8de8da607..4333b732a 100644 --- a/src/preproc/tbl/tbl.am +++ b/src/preproc/tbl/tbl.am @@ -48,7 +48,6 @@ TESTS += $(tbl_TESTS) EXTRA_DIST += $(tbl_TESTS) tbl_XFAIL_TESTS = \ - src/preproc/tbl/tests/boxes-and-vertical-rules.sh \ src/preproc/tbl/tests/expand-region-option-works.sh \ src/preproc/tbl/tests/table-lacks-spurious-top-border.sh \ src/preproc/tbl/tests/x-column-modifier-works.sh diff --git a/src/preproc/tbl/tests/check-horizontal-line-length.sh b/src/preproc/tbl/tests/check-horizontal-line-length.sh index eeb49133e..3d5e2a23c 100755 --- a/src/preproc/tbl/tests/check-horizontal-line-length.sh +++ b/src/preproc/tbl/tests/check-horizontal-line-length.sh @@ -56,8 +56,8 @@ _ echo "checking intersection of vertical and horizontal rules" >&2 output=$(printf "%s" "$input" | "$groff" -Tascii -t) -echo "$output" | sed -n '1p' | grep -Eqx '\+-{11}\+' || wail -echo "$output" | sed -n '3p' | grep -Eqx '\+-{11}\+' || wail +echo "$output" | sed -n '1p' | grep -Eqx '\+-{12}\+' || wail +echo "$output" | sed -n '3p' | grep -Eqx '\+-{12}\+' || wail input='.ll 12n .TS @@ -70,8 +70,8 @@ L. echo "checking width of boxed table" >&2 output=$(printf "%s" "$input" | "$groff" -Tascii -t) -echo "$output" | sed -n '1p' | grep -Eqx '\+-{11}\+' || wail -echo "$output" | sed -n '3p' | grep -Eqx '\+-{11}\+' || wail +echo "$output" | sed -n '1p' | grep -Eqx '\+-{12}\+' || wail +echo "$output" | sed -n '3p' | grep -Eqx '\+-{12}\+' || wail test -z "$fail" diff --git a/src/preproc/tbl/tests/check-line-intersections.sh b/src/preproc/tbl/tests/check-line-intersections.sh index 98f803639..2012bebaf 100755 --- a/src/preproc/tbl/tests/check-line-intersections.sh +++ b/src/preproc/tbl/tests/check-line-intersections.sh @@ -42,7 +42,7 @@ echo "$output" for l in 1 3 5 7 do echo "checking intersections on line $l" - echo "$output" | sed -n ${l}p | grep -Fqx '+--+---+---+' || wail + echo "$output" | sed -n ${l}p | grep -Fqx '+---+---+---+' || wail done # TODO: Check `-Tutf8` output for correct crossing glyph identities. diff --git a/src/preproc/tbl/tests/check-vertical-line-length.sh b/src/preproc/tbl/tests/check-vertical-line-length.sh index 9b08dcb68..1aafd0913 100755 --- a/src/preproc/tbl/tests/check-vertical-line-length.sh +++ b/src/preproc/tbl/tests/check-vertical-line-length.sh @@ -42,7 +42,7 @@ _ echo "checking length of plain vertical rule" >&2 output=$(printf "%s" "$input" | "$groff" -Tascii -t) -echo "$output" | sed -n '2p' | grep -Fqx -- '|1234567890 |' || wail +echo "$output" | sed -n '2p' | grep -Fqx -- '| 1234567890 |' || wail test -z "$fail" |