]> git.cameronkatri.com Git - mandoc.git/commitdiff
Give man(7) section and subsection headers hanging indentation.
authorIngo Schwarze <schwarze@openbsd.org>
Sat, 4 Apr 2015 18:52:51 +0000 (18:52 +0000)
committerIngo Schwarze <schwarze@openbsd.org>
Sat, 4 Apr 2015 18:52:51 +0000 (18:52 +0000)
Reduces groff-mandoc differences in base by about 2.5% due to
various Perl manuals having long section titles.
Quirk found in argtable2(3).

man_term.c

index 93b664a9df9cf24a584e70f8ab6ff11c7c000e92..d4a03de840c6d391afaa413cfcbc5b6d5b4dfa4d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: man_term.c,v 1.175 2015/04/04 17:47:18 schwarze Exp $ */
+/*     $Id: man_term.c,v 1.176 2015/04/04 18:52:51 schwarze Exp $ */
 /*
  * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -768,9 +768,15 @@ pre_SS(DECL_ARGS)
        case ROFFT_HEAD:
                term_fontrepl(p, TERMFONT_BOLD);
                p->offset = term_len(p, 3);
+               p->rmargin = mt->offset;
+               p->trailspace = mt->offset;
+               p->flags |= TERMP_NOBREAK | TERMP_BRIND;
                break;
        case ROFFT_BODY:
                p->offset = mt->offset;
+               p->rmargin = p->maxrmargin;
+               p->trailspace = 0;
+               p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND);
                break;
        default:
                break;
@@ -823,9 +829,15 @@ pre_SH(DECL_ARGS)
        case ROFFT_HEAD:
                term_fontrepl(p, TERMFONT_BOLD);
                p->offset = 0;
+               p->rmargin = mt->offset;
+               p->trailspace = mt->offset;
+               p->flags |= TERMP_NOBREAK | TERMP_BRIND;
                break;
        case ROFFT_BODY:
                p->offset = mt->offset;
+               p->rmargin = p->maxrmargin;
+               p->trailspace = 0;
+               p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND);
                break;
        default:
                break;