=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.260 retrieving revision 1.263 diff -u -p -r1.260 -r1.263 --- mandoc/mdoc_term.c 2014/03/30 19:47:48 1.260 +++ mandoc/mdoc_term.c 2014/04/08 07:13:12 1.263 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.260 2014/03/30 19:47:48 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.263 2014/04/08 07:13:12 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze @@ -622,7 +622,7 @@ static int termp_ll_pre(DECL_ARGS) { - (*p->setwidth)(p, n->nchild ? a2width(p, n->child->string) : 0); + term_setwidth(p, n->nchild ? n->child->string : NULL); return(0); } @@ -819,14 +819,14 @@ termp_it_pre(DECL_ARGS) MDOC_Bd == n->next->child->tok)) break; - p->flags |= TERMP_NOBREAK | TERMP_HANG; + p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG; p->trailspace = 1; break; case (LIST_tag): if (MDOC_HEAD != n->type) break; - p->flags |= TERMP_NOBREAK; + p->flags |= TERMP_NOBREAK | TERMP_BRIND; p->trailspace = 2; if (NULL == n->next || NULL == n->next->child) @@ -848,7 +848,7 @@ termp_it_pre(DECL_ARGS) case (LIST_diag): if (MDOC_HEAD != n->type) break; - p->flags |= TERMP_NOBREAK; + p->flags |= TERMP_NOBREAK | TERMP_BRIND; p->trailspace = 1; break; default: @@ -1002,9 +1002,8 @@ termp_it_post(DECL_ARGS) * has munged them in the meanwhile. */ - p->flags &= ~TERMP_DANGLE; - p->flags &= ~TERMP_NOBREAK; - p->flags &= ~TERMP_HANG; + p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | + TERMP_DANGLE | TERMP_HANG); p->trailspace = 0; } @@ -1029,6 +1028,8 @@ termp_nm_pre(DECL_ARGS) MDOC_TEXT == n->prev->child->type ? term_strlen(p, n->prev->child->string) : term_len(p, 5)); + if (p->rmargin < p->offset) + p->rmargin = p->offset; return(1); } @@ -1039,7 +1040,7 @@ termp_nm_pre(DECL_ARGS) synopsis_pre(p, n->parent); if (MDOC_HEAD == n->type && n->next->child) { - p->flags |= TERMP_NOSPACE | TERMP_NOBREAK; + p->flags |= TERMP_NOSPACE | TERMP_NOBREAK | TERMP_BRIND; p->trailspace = 1; p->rmargin = p->offset + term_len(p, 1); if (NULL == n->child) { @@ -1070,7 +1071,7 @@ termp_nm_post(DECL_ARGS) p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); } else if (MDOC_HEAD == n->type && n->next->child) { term_flushln(p); - p->flags &= ~(TERMP_NOBREAK | TERMP_HANG); + p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG); p->trailspace = 0; } else if (MDOC_BODY == n->type && n->child) term_flushln(p); @@ -1559,7 +1560,7 @@ termp_fn_pre(DECL_ARGS) if (pretty) { rmargin = p->rmargin; p->rmargin = p->offset + term_len(p, 4); - p->flags |= TERMP_NOBREAK | TERMP_HANG; + p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG; } assert(MDOC_TEXT == n->type); @@ -1569,7 +1570,7 @@ termp_fn_pre(DECL_ARGS) if (pretty) { term_flushln(p); - p->flags &= ~(TERMP_NOBREAK | TERMP_HANG); + p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG); p->offset = p->rmargin; p->rmargin = rmargin; } @@ -2061,14 +2062,16 @@ termp_fo_pre(DECL_ARGS) if (pretty) { rmargin = p->rmargin; p->rmargin = p->offset + term_len(p, 4); - p->flags |= TERMP_NOBREAK | TERMP_HANG; + p->flags |= TERMP_NOBREAK | TERMP_BRIND | + TERMP_HANG; } p->flags |= TERMP_NOSPACE; term_word(p, "("); p->flags |= TERMP_NOSPACE; if (pretty) { term_flushln(p); - p->flags &= ~(TERMP_NOBREAK | TERMP_HANG); + p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | + TERMP_HANG); p->offset = p->rmargin; p->rmargin = rmargin; }