From cb574fba99de6900929ef272a818f2b4c756abbd Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Sat, 15 May 2010 16:18:23 +0000 Subject: Make the output width an option for ascii_alloc and use that to compute the default margin. Hard-code 80 chars/line for now. --- man_term.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'man_term.c') diff --git a/man_term.c b/man_term.c index 5da984aa..a31c8d74 100644 --- a/man_term.c +++ b/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.64 2010/05/15 15:54:39 kristaps Exp $ */ +/* $Id: man_term.c,v 1.65 2010/05/15 16:18:23 joerg Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -163,7 +163,7 @@ terminal_man(void *arg, const struct man *man) p = (struct termp *)arg; p->overstep = 0; - p->maxrmargin = 65; + p->maxrmargin = p->defrmargin; if (NULL == p->symtab) switch (p->enc) { @@ -803,6 +803,7 @@ post_RS(DECL_ARGS) static void print_man_node(DECL_ARGS) { + size_t rm, rmax; int c; c = 1; @@ -819,10 +820,13 @@ print_man_node(DECL_ARGS) /* FIXME: this means that macro lines are munged! */ if (MANT_LITERAL & mt->fl) { + rm = p->rmargin; + rmax = p->maxrmargin; p->rmargin = p->maxrmargin = TERM_MAXMARGIN; p->flags |= TERMP_NOSPACE; term_flushln(p); - p->rmargin = p->maxrmargin = 65; + p->rmargin = rm; + p->maxrmargin = rmax; } break; default: -- cgit v1.2.3-56-ge451