summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-04-06 14:58:54 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-04-06 14:58:54 +0000
commit774695a67bc363bb27f393c0fcff335f347117c5 (patch)
tree28af8a5b3988c43ab3181ad49e2616ce044d0538
parentff02510c7b17424301cc0d012e7fefa5a91b2f3f (diff)
On a new RS nesting level, the saved width starts from the default
width, not from the saved width of the previous level. Improves xterm(1) and XSetEventQueueOwner(3); found in transcode_filter(1).
-rw-r--r--regress/usr.bin/mandoc/man/RS/nested.in10
-rw-r--r--regress/usr.bin/mandoc/man/RS/nested.out_ascii10
-rw-r--r--usr.bin/mandoc/man_term.c4
3 files changed, 20 insertions, 4 deletions
diff --git a/regress/usr.bin/mandoc/man/RS/nested.in b/regress/usr.bin/mandoc/man/RS/nested.in
index ca440e3f295..7650e43f971 100644
--- a/regress/usr.bin/mandoc/man/RS/nested.in
+++ b/regress/usr.bin/mandoc/man/RS/nested.in
@@ -15,6 +15,16 @@ outer
text
.RE
regular text
+.IP tag 6n
+tagged text (6n)
+.RS
+outer text (saved 6n)
+.RS
+inner text (default indent)
+.RE
+outer text
+.RE
+regular text
.RS 4n
outer text (4n)
.RS 2n
diff --git a/regress/usr.bin/mandoc/man/RS/nested.out_ascii b/regress/usr.bin/mandoc/man/RS/nested.out_ascii
index cb599754e91..f64bc5afb6e 100644
--- a/regress/usr.bin/mandoc/man/RS/nested.out_ascii
+++ b/regress/usr.bin/mandoc/man/RS/nested.out_ascii
@@ -11,6 +11,12 @@ DDEESSCCRRIIPPTTIIOONN
inner text (default indent)
outer text
regular text
+
+ tag tagged text (6n)
+ outer text (saved 6n)
+ inner text (default indent)
+ outer text
+ regular text
outer text (4n)
inner text (2n)
outer text
@@ -25,10 +31,10 @@ DDEESSCCRRIIPPTTIIOONN
outer text
nesting HP and RS inside RS:
- outer text
+ outer text
- inner text
+ inner text
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 066d25c707f..ef2cfefc014 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_term.c,v 1.130 2015/04/06 13:34:54 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.131 2015/04/06 14:58:53 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -893,7 +893,7 @@ pre_RS(DECL_ARGS)
if (++mt->lmarginsz < MAXMARGINS)
mt->lmargincur = mt->lmarginsz;
- mt->lmargin[mt->lmargincur] = mt->lmargin[mt->lmargincur - 1];
+ mt->lmargin[mt->lmargincur] = term_len(p, p->defindent);
return(1);
}