aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit22263071d729e5d19d22c171e8f31fa516fb4721 (patch)
tree2543d12ce51a73d016b95dd4072234a1fc01fb89
parent9a4d1bb76f454b09791b346367dc48d91993a014 (diff)
downloadmandoc-22263071d729e5d19d22c171e8f31fa516fb4721.tar.gz
mandoc-22263071d729e5d19d22c171e8f31fa516fb4721.tar.zst
mandoc-22263071d729e5d19d22c171e8f31fa516fb4721.zip
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.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/man_term.c b/man_term.c
index 2ab8ea3e..a79e5e27 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.182 2015/04/19 14:00:19 schwarze Exp $ */
+/* $Id: man_term.c,v 1.183 2015/04/19 19:44:21 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);
}