-/* $Id: mdoc_term.c,v 1.126 2010/05/17 23:57:06 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.130 2010/05/24 21:51:20 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
p->overstep = 0;
p->maxrmargin = p->defrmargin;
+ p->tabwidth = 5;
if (NULL == p->symtab)
switch (p->enc) {
/* A `-column' does not assert vspace within the list. */
- if (MDOC_Bl == bl->tok && LIST_diag == bl->data.list)
+ if (MDOC_Bl == bl->tok && LIST_column == bl->data.list)
if (n->prev && MDOC_It == n->prev->tok)
return;
/* FALLTHROUGH */
case (LIST_inset):
if (MDOC_BODY == n->type)
- term_flushln(p);
+ term_newln(p);
break;
case (LIST_column):
if (MDOC_HEAD == n->type)
term_flushln(p);
break;
default:
- term_flushln(p);
+ term_newln(p);
break;
}
{
if (NULL == n->child && NULL == m->name)
+ return(1);
if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags)
term_newln(p);
static int
termp_bd_pre(DECL_ARGS)
{
+ size_t tabwidth;
int i, type;
size_t rm, rmax;
const struct mdoc_node *nn;
if (MDOC_Literal != type && MDOC_Unfilled != type)
return(1);
+ tabwidth = p->tabwidth;
+ p->tabwidth = 8;
rm = p->rmargin;
rmax = p->maxrmargin;
p->rmargin = p->maxrmargin = TERM_MAXMARGIN;
for (nn = n->child; nn; nn = nn->next) {
p->flags |= TERMP_NOSPACE;
print_mdoc_node(p, pair, m, nn);
- if (NULL == nn->next)
- continue;
- if (nn->prev && nn->prev->line < nn->line)
- term_flushln(p);
- else if (NULL == nn->prev)
+ if (NULL == nn->prev ||
+ nn->prev->line < nn->line ||
+ NULL == nn->next)
term_flushln(p);
}
+ p->tabwidth = tabwidth;
p->rmargin = rm;
p->maxrmargin = rmax;
p->rmargin = p->maxrmargin = TERM_MAXMARGIN;
p->flags |= TERMP_NOSPACE;
- term_flushln(p);
+ term_newln(p);
p->rmargin = rm;
p->maxrmargin = rmax;