summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-04-14 19:34:54 +0000
committerschwarze <schwarze@openbsd.org>2017-04-14 19:34:54 +0000
commit97970a6243cf0d263a65c4fd1bd4c20caa2ef554 (patch)
tree53a48c8ec626a1edd3bb62d719241ecb7e9d56a2
parentAdd test for IP payload compression. It is sending small and big (diff)
downloadwireguard-openbsd-97970a6243cf0d263a65c4fd1bd4c20caa2ef554.tar.xz
wireguard-openbsd-97970a6243cf0d263a65c4fd1bd4c20caa2ef554.zip
Show long .Lk URIs in like an indented display, similar to groff.
Suggested by bentley@.
-rw-r--r--usr.bin/mandoc/mdoc_term.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index 8605cf23208..13f450dd40e 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_term.c,v 1.246 2017/04/14 18:23:29 schwarze Exp $ */
+/* $OpenBSD: mdoc_term.c,v 1.247 2017/04/14 19:34:54 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -1991,6 +1991,7 @@ static int
termp_lk_pre(DECL_ARGS)
{
const struct roff_node *link, *descr;
+ int display;
if (NULL == (link = n->child))
return 0;
@@ -2006,10 +2007,19 @@ termp_lk_pre(DECL_ARGS)
term_word(p, ":");
}
+ display = term_strlen(p, link->string) >= 26;
+ if (display) {
+ term_newln(p);
+ p->offset += term_len(p, p->defindent + 1);
+ }
+
term_fontpush(p, TERMFONT_BOLD);
term_word(p, link->string);
term_fontpop(p);
+ if (display)
+ term_newln(p);
+
return 0;
}