summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-07-16 00:03:37 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-07-16 00:03:37 +0000
commit8e9a700f6c3099ee1339933226c37abe1aabedd9 (patch)
treecc2cbf6302c2c7de109d62a5e333649b9ea20c69 /mdoc_term.c
parent311cf8189e0b75a760c83c3fca31030f3ad4ecca (diff)
downloadmandoc-8e9a700f6c3099ee1339933226c37abe1aabedd9.tar.gz
After .Sm on, spacing ought to restart right away, before the next token,
and not with a delay, after the next token. But be careful not to cause leading white space at the beginning of a line or column. In OpenBSD, improves chmod(1), ksh(1), tar(1), ps(1) and probably many more. ok kristaps@ and tested by jmc@ and sobrado@
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 978b317c..117ac1e1 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -2066,9 +2066,11 @@ termp_sm_pre(DECL_ARGS)
{
assert(n->child && MDOC_TEXT == n->child->type);
- if (0 == strcmp("on", n->child->string))
+ if (0 == strcmp("on", n->child->string)) {
+ if (p->col)
+ p->flags &= ~TERMP_NOSPACE;
p->flags &= ~TERMP_NONOSPACE;
- else
+ } else
p->flags |= TERMP_NONOSPACE;
return(0);