diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-04 22:44:15 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-04 22:44:15 +0000 |
commit | 57a85465cebb415008468ba9f16a7668e9119051 (patch) | |
tree | d342974ea656a6dfa44886c5469b783de62b7078 /man_term.c | |
parent | 68a2cb887c993621fe7b72e21517d6a260376003 (diff) | |
download | mandoc-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.c | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -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; |