diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2010-05-24 21:34:16 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2010-05-24 21:34:16 +0000 |
commit | e02845a612e170851ce8a57d88d5ddf83b80b3d6 (patch) | |
tree | 8f3fb70042dbabcf1eccb3b2d0d84b6d1a317e93 /mdoc_term.c | |
parent | e47604840546989588e20d7885d0fba3897f3c00 (diff) | |
download | mandoc-e02845a612e170851ce8a57d88d5ddf83b80b3d6.tar.gz mandoc-e02845a612e170851ce8a57d88d5ddf83b80b3d6.tar.zst mandoc-e02845a612e170851ce8a57d88d5ddf83b80b3d6.zip |
Handle literal tab characters both in literal context (.Bd -literal)
and outside. In literal context, tab stops are at each eigth column;
outside, they are at each fifth column.
from OpenBSD mdoc_term.c rev. 1.75;
"commit" kristaps@
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index c030e337..d3593093 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.128 2010/05/24 14:35:59 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.129 2010/05/24 21:34:16 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -274,6 +274,7 @@ terminal_mdoc(void *arg, const struct mdoc *mdoc) p->overstep = 0; p->maxrmargin = p->defrmargin; + p->tabwidth = 5; if (NULL == p->symtab) switch (p->enc) { @@ -1593,6 +1594,7 @@ termp_fa_pre(DECL_ARGS) static int termp_bd_pre(DECL_ARGS) { + size_t tabwidth; int i, type; size_t rm, rmax; const struct mdoc_node *nn; @@ -1622,6 +1624,8 @@ termp_bd_pre(DECL_ARGS) if (MDOC_Literal != type && MDOC_Unfilled != type) return(1); + tabwidth = p->tabwidth; + p->tabwidth = 8; rm = p->rmargin; rmax = p->maxrmargin; p->rmargin = p->maxrmargin = TERM_MAXMARGIN; @@ -1636,6 +1640,7 @@ termp_bd_pre(DECL_ARGS) else if (NULL == nn->prev) term_flushln(p); } + p->tabwidth = tabwidth; p->rmargin = rm; p->maxrmargin = rmax; |