summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-05-24 21:34:16 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-05-24 21:34:16 +0000
commitd0f1de7c988060895fa78550174754f334d3b8ff (patch)
treec38044c47a818a179479eeabe5568f73aa96cd7d /mdoc_term.c
parent1168cba5930f4bb623acc6ddd0637b0d1ac272a5 (diff)
downloadmandoc-d0f1de7c988060895fa78550174754f334d3b8ff.tar.gz
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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 82723204..5247c2f9 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -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;