source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: When calculating the with of spanned columns, which for example
@ 2022-04-08 16:54 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2022-04-08 16:54 UTC (permalink / raw)
  To: source

Log Message:
-----------
When calculating the with of spanned columns, which for example matters
for centering text spanning multiple tbl(7) columns, correctly account
for the spacing between columns instead of wrongly assuming the default 
spacing of 3n.

Patch from Simon Branch <simonmbranch at gmail dot com>.

Modified Files:
--------------
    mandoc:
        tbl_term.c

Revision Data
-------------
Index: tbl_term.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/tbl_term.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -Ltbl_term.c -Ltbl_term.c -u -p -r1.75 -r1.76
--- tbl_term.c
+++ tbl_term.c
@@ -820,8 +820,11 @@ tbl_literal(struct termp *tp, const stru
 	width = col->width;
 	ic = dp->layout->col;
 	hspans = dp->hspans;
-	while (hspans--)
-		width += tp->tbl.cols[++ic].width + 3;
+	while (hspans--) {
+		width += tp->tbl.cols[ic].spacing;
+		ic++;
+		width += tp->tbl.cols[ic].width;
+	}
 
 	padr = width > len ? width - len : 0;
 	padl = 0;
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-08 16:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 16:54 mandoc: When calculating the with of spanned columns, which for example schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).