diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2010-05-24 21:51:20 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2010-05-24 21:51:20 +0000 |
commit | e4081855b3ccc752fd8d5c743e87ad84478c748c (patch) | |
tree | 3547f69f52972cb996e650c41652f7fd47b5cf5a /mdoc_term.c | |
parent | d0f1de7c988060895fa78550174754f334d3b8ff (diff) | |
download | mandoc-e4081855b3ccc752fd8d5c743e87ad84478c748c.tar.gz |
sync to OpenBSD:
save the visual cursor position in term_flushln()
and use that to avoid multiple blank lines in nested lists while
still putting subsequent empty list tags each on their own line;
"go ahead" kristaps@
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index 5247c2f9..7861e080 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1014,14 +1014,14 @@ termp_it_post(DECL_ARGS) /* 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; } @@ -1633,11 +1633,9 @@ termp_bd_pre(DECL_ARGS) 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; @@ -1668,7 +1666,7 @@ termp_bd_post(DECL_ARGS) p->rmargin = p->maxrmargin = TERM_MAXMARGIN; p->flags |= TERMP_NOSPACE; - term_flushln(p); + term_newln(p); p->rmargin = rm; p->maxrmargin = rmax; |