summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-05-24 21:51:20 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-05-24 21:51:20 +0000
commit4f3f2467baac85e3e184ff13cf9d87c8cad0e577 (patch)
tree5b6ae096c3fd5249306aeb28e32e346cd6957ca7 /mdoc_term.c
parente02845a612e170851ce8a57d88d5ddf83b80b3d6 (diff)
downloadmandoc-4f3f2467baac85e3e184ff13cf9d87c8cad0e577.tar.gz
mandoc-4f3f2467baac85e3e184ff13cf9d87c8cad0e577.tar.zst
mandoc-4f3f2467baac85e3e184ff13cf9d87c8cad0e577.zip
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.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index d3593093..3503483a 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.129 2010/05/24 21:34:16 schwarze 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>
*
@@ -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;