source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: do not print horizontal lines inside vertical spans
Date: Sun, 19 Aug 2018 14:32:51 -0500 (EST)	[thread overview]
Message-ID: <c89f168afc4238eb@fantadrom.bsd.lv> (raw)

Log Message:
-----------
do not print horizontal lines inside vertical spans

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.58
retrieving revision 1.59
diff -Ltbl_term.c -Ltbl_term.c -u -p -r1.58 -r1.59
--- tbl_term.c
+++ tbl_term.c
@@ -460,13 +460,11 @@ tbl_hrule(struct termp *tp, const struct
 	const struct tbl_cell *cp, *cpn, *cpp;
 	const struct roffcol *col;
 	int	 vert;
-	char	 line, cross;
+	char	 cross, line, stdcross, stdline;
 
-	line = (kind < 2 && TBL_SPAN_DHORIZ == sp->pos) ? '=' : '-';
-	cross = (kind < 3) ? '+' : '-';
+	stdline = (kind < 2 && TBL_SPAN_DHORIZ == sp->pos) ? '=' : '-';
+	stdcross = (kind < 3) ? '+' : '-';
 
-	if (kind)
-		term_word(tp, "+");
 	cp = sp->layout->first;
 	cpp = kind || sp->prev == NULL ? NULL : sp->prev->layout->first;
 	if (cpp == cp)
@@ -474,8 +472,18 @@ tbl_hrule(struct termp *tp, const struct
 	cpn = kind > 1 || sp->next == NULL ? NULL : sp->next->layout->first;
 	if (cpn == cp)
 		cpn = NULL;
+	if (kind)
+		term_word(tp,
+		    cpn == NULL || cpn->pos != TBL_CELL_DOWN ? "+" : "|");
 	for (;;) {
 		col = tp->tbl.cols + cp->col;
+		if (cpn == NULL || cpn->pos != TBL_CELL_DOWN) {
+			line = stdline;
+			cross = stdcross;
+		} else {
+			line = ' ';
+			cross = (kind < 3) ? '|' : ' ';
+		}
 		tbl_char(tp, line, col->width + col->spacing / 2);
 		vert = cp->vert;
 		if ((cp = cp->next) == NULL)
@@ -490,6 +498,11 @@ tbl_hrule(struct termp *tp, const struct
 				vert = cpn->vert;
 			cpn = cpn->next;
 		}
+		if (cpn == NULL || cpn->pos != TBL_CELL_DOWN) {
+			line = stdline;
+			cross = stdcross;
+		} else
+			line = ' ';
 		if (sp->opts->opts & TBL_OPT_ALLBOX && !vert)
 			vert = 1;
 		if (col->spacing)
@@ -500,7 +513,8 @@ tbl_hrule(struct termp *tp, const struct
 			tbl_char(tp, line, (col->spacing - 3) / 2);
 	}
 	if (kind) {
-		term_word(tp, "+");
+		term_word(tp,
+		    cpn == NULL || cpn->pos != TBL_CELL_DOWN ? "+" : "|");
 		term_flushln(tp);
 	}
 }
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2018-08-19 19:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c89f168afc4238eb@fantadrom.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).