-/* $Id: mdoc_term.c,v 1.256 2013/12/25 14:40:34 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.259 2014/02/16 12:33:39 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de>
*
* Permission to use, copy, modify, and distribute this software for any
assert(width);
if (MDOC_HEAD == n->type)
p->rmargin = p->offset + width;
- else
+ else {
p->offset += width;
+ if (p->rmargin < p->offset)
+ p->rmargin = p->offset;
+ }
break;
case (LIST_column):
assert(width);
static int
termp_fn_pre(DECL_ARGS)
{
- size_t width, rmargin = 0;
+ size_t rmargin = 0;
int pretty;
pretty = MDOC_SYNPRETTY & n->flags;
return(0);
if (pretty) {
- width = term_len(p, 4);
rmargin = p->rmargin;
- p->rmargin = p->offset + width;
+ p->rmargin = p->offset + term_len(p, 4);
p->flags |= TERMP_NOBREAK | TERMP_HANG;
}
for (nn = n->child; nn; nn = nn->next) {
term_fontpush(p, TERMFONT_UNDER);
- if (MDOC_SYNPRETTY & n->flags)
- p->flags |= TERMP_NBRWORD;
+ p->flags |= TERMP_NBRWORD;
term_word(p, nn->string);
term_fontpop(p);
static int
termp_fo_pre(DECL_ARGS)
{
- size_t width, rmargin = 0;
+ size_t rmargin = 0;
int pretty;
pretty = MDOC_SYNPRETTY & n->flags;
return(1);
} else if (MDOC_BODY == n->type) {
if (pretty) {
- width = term_len(p, 4);
rmargin = p->rmargin;
- p->rmargin = p->offset + width;
+ p->rmargin = p->offset + term_len(p, 4);
p->flags |= TERMP_NOBREAK | TERMP_HANG;
}
p->flags |= TERMP_NOSPACE;