diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-12-25 00:39:31 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-12-25 00:39:31 +0000 |
commit | ae3f51d742a1c36dd2092d91c57e3885d28a21f5 (patch) | |
tree | 743265550f2e5411f8f89f8d493d55658fe50acc /mdoc_man.c | |
parent | 4502d03c03ab81e38efc29a83958d57f9d2a3a36 (diff) | |
download | mandoc-ae3f51d742a1c36dd2092d91c57e3885d28a21f5.tar.gz |
Do not break output lines in .Fn function arguments in SYNOPSIS mode.
Following an idea from Franco Fichtner, but implemented more cleanly.
This reduces groff-mandoc-differences in OpenBSD base by a fantastic 7.5%.
Diffstat (limited to 'mdoc_man.c')
-rw-r--r-- | mdoc_man.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -256,6 +256,7 @@ static int outflags; #define MMAN_An_split (1 << 9) /* author mode is "split" */ #define MMAN_An_nosplit (1 << 10) /* author mode is "nosplit" */ #define MMAN_PD (1 << 11) /* inter-paragraph spacing disabled */ +#define MMAN_nbrword (1 << 12) /* do not break the next word */ #define BL_STACK_MAX 32 @@ -364,6 +365,12 @@ print_word(const char *s) case (ASCII_HYPH): putchar('-'); break; + case (' '): + if (MMAN_nbrword & outflags) { + printf("\\ "); + break; + } + /* FALLTHROUGH */ default: putchar((unsigned char)*s); break; @@ -371,6 +378,7 @@ print_word(const char *s) if (TPremain) TPremain--; } + outflags &= ~MMAN_nbrword; } static void @@ -1028,6 +1036,8 @@ pre_fa(DECL_ARGS) while (NULL != n) { font_push('I'); + if (MDOC_SYNPRETTY & n->flags) + outflags |= MMAN_nbrword; print_node(meta, n); font_pop(); if (NULL != (n = n->next)) |