summaryrefslogtreecommitdiffstats
path: root/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-04 22:44:15 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-04 22:44:15 +0000
commit57a85465cebb415008468ba9f16a7668e9119051 (patch)
treed342974ea656a6dfa44886c5469b783de62b7078 /man_term.c
parent68a2cb887c993621fe7b72e21517d6a260376003 (diff)
downloadmandoc-57a85465cebb415008468ba9f16a7668e9119051.tar.gz
Implement the roff(7) .mc (right margin character) request.
The Tcl/Tk manual pages use this extensively. Delete the TERM_MAXMARGIN hack, it breaks .mc inside .nf; instead, implement a proper TERMP_BRNEVER flag.
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/man_term.c b/man_term.c
index b86af98f..8a047d8b 100644
--- a/man_term.c
+++ b/man_term.c
@@ -862,7 +862,6 @@ post_UR(DECL_ARGS)
static void
print_man_node(DECL_ARGS)
{
- size_t rm, rmax;
int c;
switch (n->type) {
@@ -930,20 +929,16 @@ out:
if (mt->fl & MANT_LITERAL &&
! (p->flags & (TERMP_NOBREAK | TERMP_NONEWLINE)) &&
(n->next == NULL || n->next->flags & NODE_LINE)) {
- rm = p->rmargin;
- rmax = p->maxrmargin;
- p->rmargin = p->maxrmargin = TERM_MAXMARGIN;
- p->flags |= TERMP_NOSPACE;
+ p->flags |= TERMP_BRNEVER | TERMP_NOSPACE;
if (n->string != NULL && *n->string != '\0')
term_flushln(p);
else
term_newln(p);
- if (rm < rmax && n->parent->tok == MAN_HP) {
- p->offset = rm;
- p->rmargin = rmax;
- } else
- p->rmargin = rm;
- p->maxrmargin = rmax;
+ p->flags &= ~TERMP_BRNEVER;
+ if (p->rmargin < p->maxrmargin && n->parent->tok == MAN_HP) {
+ p->offset = p->rmargin;
+ p->rmargin = p->maxrmargin;
+ }
}
if (NODE_EOS & n->flags)
p->flags |= TERMP_SENTENCE;