summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-09 16:38:38 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-09 16:38:38 +0000
commit51498304d771a59375a440a6288a260e9848f18f (patch)
treec178e1af9bb17dd5e355d97842104d445b461791 /mdoc_term.c
parent128e414f1c82f7607806f15487777c93565529c7 (diff)
downloadmandoc-51498304d771a59375a440a6288a260e9848f18f.tar.gz
mandoc-51498304d771a59375a440a6288a260e9848f18f.tar.zst
mandoc-51498304d771a59375a440a6288a260e9848f18f.zip
Setting maxmargin, too (for completion).
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index d407ec96..f8824910 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.118 2010/05/09 16:05:13 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.119 2010/05/09 16:38:38 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1629,7 +1629,7 @@ static int
termp_bd_pre(DECL_ARGS)
{
int i, type;
- size_t sv;
+ size_t rm, rmax;
const struct mdoc_node *nn;
if (MDOC_BLOCK == n->type) {
@@ -1657,8 +1657,9 @@ termp_bd_pre(DECL_ARGS)
if (MDOC_Literal != type && MDOC_Unfilled != type)
return(1);
- sv = p->rmargin;
- p->rmargin = 100000; /* FIXME */
+ rm = p->rmargin;
+ rmax = p->maxrmargin;
+ p->rmargin = p->maxrmargin = 100000; /* FIXME */
for (nn = n->child; nn; nn = nn->next) {
p->flags |= TERMP_NOSPACE;
@@ -1671,7 +1672,8 @@ termp_bd_pre(DECL_ARGS)
term_flushln(p);
}
- p->rmargin = sv;
+ p->rmargin = rm;
+ p->maxrmargin = rmax;
return(0);
}
@@ -1681,7 +1683,7 @@ static void
termp_bd_post(DECL_ARGS)
{
int type;
- size_t sv;
+ size_t rm, rmax;
if (MDOC_BODY != n->type)
return;
@@ -1689,15 +1691,17 @@ termp_bd_post(DECL_ARGS)
type = arg_disptype(n->parent);
assert(-1 != type);
- sv = p->rmargin;
+ rm = p->rmargin;
+ rmax = p->maxrmargin;
if (MDOC_Literal == type || MDOC_Unfilled == type)
- p->rmargin = 100000; /* FIXME */
+ p->rmargin = p->maxrmargin = 100000; /* FIXME */
p->flags |= TERMP_NOSPACE;
term_flushln(p);
- p->rmargin = sv;
+ p->rmargin = rm;
+ p->maxrmargin = rmax;
}