summaryrefslogtreecommitdiffstatshomepage
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
commit24950cd03524c6d1710195833b370b4772ceb4ba (patch)
tree11fbbe2226dbc95e66de221e249c615ea0752f5d
parent7212aba6ed3fc08bd8136dd981255421a2104551 (diff)
downloadmandoc-24950cd03524c6d1710195833b370b4772ceb4ba.tar.gz
mandoc-24950cd03524c6d1710195833b370b4772ceb4ba.tar.zst
mandoc-24950cd03524c6d1710195833b370b4772ceb4ba.zip
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@
-rw-r--r--mdoc_term.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index d3b753a5..0755b164 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.173 2010/07/07 15:04:54 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.174 2010/07/16 00:03:37 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);