From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o8NKe043007635 for ; Thu, 23 Sep 2010 16:40:00 -0400 (EDT) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id o8NKe0b5021922; Thu, 23 Sep 2010 16:40:00 -0400 (EDT) Date: Thu, 23 Sep 2010 16:40:00 -0400 (EDT) Message-Id: <201009232040.o8NKe0b5021922@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: When the HEAD of an .Nm block in the SYNOPSIS might be wider X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- When the HEAD of an .Nm block in the SYNOPSIS might be wider than the column containing it, the TERMP_HANG flag is required, but avoid the flag when we know that the HEAD is shorter, because in that case, the flag might ruin the alignment. Problem originally reported by jmc@, who also spotted a regression in an earlier version of this patch. "feel free to commit" kristaps@ Modified Files: -------------- mdocml: mdoc_term.c Revision Data ------------- Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.184 retrieving revision 1.185 diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.184 -r1.185 --- mdoc_term.c +++ mdoc_term.c @@ -1031,12 +1031,18 @@ termp_nm_pre(DECL_ARGS) synopsis_pre(p, n->parent); if (MDOC_HEAD == n->type && n->next->child) { - p->flags |= TERMP_NOSPACE | TERMP_NOBREAK | TERMP_HANG; - p->rmargin = p->offset + term_len(p, 1) + - (NULL == n->child ? term_strlen(p, m->name) : - MDOC_TEXT == n->child->type ? - term_strlen(p, n->child->string) : - term_len(p, 5)); + p->flags |= TERMP_NOSPACE | TERMP_NOBREAK; + p->rmargin = p->offset + term_len(p, 1); + if (NULL == n->child) { + p->rmargin += term_strlen(p, m->name); + } else if (MDOC_TEXT == n->child->type) { + p->rmargin += term_strlen(p, n->child->string); + if (n->child->next) + p->flags |= TERMP_HANG; + } else { + p->rmargin += term_len(p, 5); + p->flags |= TERMP_HANG; + } } term_fontpush(p, TERMFONT_BOLD); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv