summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-19 19:44:21 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-19 19:44:21 +0000
commite18dbd74bdc94bba48047a6551e73170b54e8ed1 (patch)
tree62fa079aadfb2c3e3d3eb1bcc62d3e5a82310791
parent9b3bf5ac96248ef8c6aa778a87ac5d5107e03d53 (diff)
downloadmandoc-e18dbd74bdc94bba48047a6551e73170b54e8ed1.tar.gz
If an explicit line break request (.br or .sp) occurs within an .HP block,
the next line doesn't hang, but is simply indented. Issue found by Christian Neukirchen <chneukirchen at gmail dot com> in the dmsetup(8) manual on Linux. This patch also improves the indentation of XDGA(3) and XrmGetResource(3).
-rw-r--r--man_term.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/man_term.c b/man_term.c
index 863bac22..931ab426 100644
--- a/man_term.c
+++ b/man_term.c
@@ -482,6 +482,17 @@ pre_sp(DECL_ARGS)
for (i = 0; i < len; i++)
term_vspace(p);
+ /*
+ * Handle an explicit break request in the same way
+ * as an overflowing line.
+ */
+
+ if (p->flags & TERMP_BRIND) {
+ p->offset = p->rmargin;
+ p->rmargin = p->maxrmargin;
+ p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND);
+ }
+
return(0);
}