gbranden pushed a commit to branch master
in repository groff.

commit 0d4c54e491d884dd9d5d0524a33f53d6496ddc14
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
AuthorDate: Mon Aug 11 18:36:49 2025 -0500

    [tbl]: Refactor horizontal rule generation.
    
    * src/preproc/tbl/table.cpp (table::print_single_hrule): Clarify
      generated *roff logic by restricting performance operations that are
      no-ops in nroff mode (type size changes and quarter-vee vertical
      motions) to when the `t` *roff condition is true.
---
 ChangeLog                 |  8 ++++++++
 src/preproc/tbl/table.cpp | 11 +++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1248b6561..aa5bc41c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-08-11  G. Branden Robinson <g.branden.robin...@gmail.com>
+
+       * src/preproc/tbl/table.cpp (table::print_single_hrule):
+       Refactor.  Clarify generated *roff logic by restricting
+       performance operations that are no-ops in nroff mode (type size
+       changes and quarter-vee vertical motions) to when the `t` *roff
+       condition is true.
+
 2025-08-11  G. Branden Robinson <g.branden.robin...@gmail.com>
 
        * tmac/s.tmac: Trivially refactor.
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index 80759ca55..e19c921fe 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -2553,11 +2553,12 @@ void table::compute_widths()
 void table::print_single_hrule(int r)
 {
   prints(".vs " LINE_SEP ">?\\n[.V]u\n"
-        ".ls 1\n"
+        ".ls 1\n");
+  prints(".if t "
         "\\v'" BODY_DEPTH "'"
-        "\\s[\\n[" LINESIZE_REG "]]");
+        "\\s[\\n[" LINESIZE_REG "]]\\c\n");
   if (r > nrows - 1)
-    prints("\\D'l |\\n[TW]u 0'");
+    prints("\\D'l |\\n[TW]u 0'\\c");
   else {
     int start_col = 0;
     for (;;) {
@@ -2589,7 +2590,9 @@ void table::print_single_hrule(int r)
       start_col = end_col;
     }
   }
-  prints("\\s0\n");
+  prints("\\c\n");
+  prints(".ie t \\s0\n"
+        ".el   \\&\n");
   prints(".ls\n"
         ".vs\n");
 }

_______________________________________________
groff-commit mailing list
groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to