summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-22 12:04:05 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-22 12:04:05 +0000
commit5ff3d11b2e760657dd7adae6fb66cdc78ebd34ad (patch)
tree83cbd924ee999aea6b128ebb6553fb4a04fdba0d /mdoc_term.c
parent39df69a9d68b05fb09136083471adee4d2817687 (diff)
downloadmandoc-5ff3d11b2e760657dd7adae6fb66cdc78ebd34ad.tar.gz
Added "Spacing" part of "Punctuation and Spacing" in mandoc.1 manual.
Fixed `Ds' meta-macro default width. Fixed -width and -offset "indent", "indent-two", and "left" widths. Fixed -width and -offset literal-word and numeric widths. Fixed off-by-one errors in whitespace output (schwarze@openbsd.org).
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index c91ffb29..f1f28e7c 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -533,9 +533,9 @@ arg_width(const struct mdoc_argv *arg, int pos)
assert(pos < (int)arg->sz && pos >= 0);
assert(arg->value[pos]);
if (0 == strcmp(arg->value[pos], "indent"))
- return(INDENT);
+ return(INDENT + 3);
if (0 == strcmp(arg->value[pos], "indent-two"))
- return(INDENT * 2);
+ return(INDENT * 2 + 2);
if (0 == (len = (int)strlen(arg->value[pos])))
return(0);
@@ -545,13 +545,14 @@ arg_width(const struct mdoc_argv *arg, int pos)
break;
if (i == len - 1) {
- if ('n' == arg->value[pos][len - 1]) {
+ if ('n' == arg->value[pos][len - 1] ||
+ 'm' == arg->value[pos][len - 1]) {
v = (size_t)atoi(arg->value[pos]);
- return(v);
+ return(v + 2);
}
}
- return(strlen(arg->value[pos]) + 1);
+ return(strlen(arg->value[pos]) + 2);
}
@@ -603,9 +604,9 @@ arg_offset(const struct mdoc_argv *arg)
assert(*arg->value);
if (0 == strcmp(*arg->value, "left"))
- return(0);
+ return(INDENT - 1);
if (0 == strcmp(*arg->value, "indent"))
- return(INDENT);
+ return(INDENT + 1);
if (0 == strcmp(*arg->value, "indent-two"))
return(INDENT * 2);
@@ -1340,7 +1341,8 @@ termp_d1_pre(DECL_ARGS)
if (MDOC_BLOCK != node->type)
return(1);
term_newln(p);
- p->offset += (pair->offset = INDENT);
+ pair->offset = INDENT + 1;
+ p->offset += pair->offset;
return(1);
}