diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-04-12 22:52:20 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-04-12 22:52:20 +0000 |
commit | 5e691b5d0facb330b3a319d6a6a4fde22d71e79b (patch) | |
tree | 8e529621ae7a7c55d88ea00f73ed616a8011c728 | |
parent | 66fb47d386607c6a3b9bf1a287cf0a4d5e3a1be6 (diff) |
Partial revert of term.c rev. 1.23
because jmc@ noticed that it broke blank lines in literal displays.
The original idea was to suppress stray blank lines.
But we don't want to suppress *all* blank lines,
instead just those caused by nested lists.
So do the check whether there was any output on this line,
i.e. whether or not to break the line,
at the right place, which is after processing the .It body.
-rw-r--r-- | usr.bin/mandoc/mdoc_term.c | 6 | ||||
-rw-r--r-- | usr.bin/mandoc/term.c | 9 |
2 files changed, 5 insertions, 10 deletions
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c index 7753102eb35..7b744c589d4 100644 --- a/usr.bin/mandoc/mdoc_term.c +++ b/usr.bin/mandoc/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.73 2010/04/07 23:15:05 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.74 2010/04/12 22:52:19 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -1020,14 +1020,14 @@ termp_it_post(DECL_ARGS) /* FALLTHROUGH */ case (MDOC_Inset): if (MDOC_BODY == n->type) - term_flushln(p); + term_newln(p); break; case (MDOC_Column): if (MDOC_HEAD == n->type) term_flushln(p); break; default: - term_flushln(p); + term_newln(p); break; } diff --git a/usr.bin/mandoc/term.c b/usr.bin/mandoc/term.c index 9ab9b693bd6..0947d5183d0 100644 --- a/usr.bin/mandoc/term.c +++ b/usr.bin/mandoc/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.27 2010/04/07 23:15:05 schwarze Exp $ */ +/* $Id: term.c,v 1.28 2010/04/12 22:52:19 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -130,7 +130,6 @@ term_flushln(struct termp *p) int j; /* temporary loop index */ int jhy; /* last hyphen before line overflow */ size_t maxvis, mmax; - static int line_started = 0; /* * First, establish the maximum columns of "visible" content. @@ -202,7 +201,6 @@ term_flushln(struct termp *p) /* LINTED */ for (j = 0; j < (int)p->offset; j++) putchar(' '); - line_started = 1; /* * Find out whether we would exceed the right margin. @@ -251,10 +249,7 @@ term_flushln(struct termp *p) p->overstep = 0; if ( ! (TERMP_NOBREAK & p->flags)) { - if (line_started) { - putchar('\n'); - line_started = 0; - } + putchar('\n'); return; } |