aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-06-27 01:26:20 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-06-27 01:26:20 +0000
commitadf4f1cf3dd98e5676c333b40212a2f4b0d1347d (patch)
tree7e2ab3273e586a7c28665998fe016c9063953d43 /term.c
parent397916af9099ebb9b23d491efef58d48d4e88133 (diff)
downloadmandoc-adf4f1cf3dd98e5676c333b40212a2f4b0d1347d.tar.gz
mandoc-adf4f1cf3dd98e5676c333b40212a2f4b0d1347d.tar.zst
mandoc-adf4f1cf3dd98e5676c333b40212a2f4b0d1347d.zip
Basic implementation of .Bk/.Ek; from OpenBSD.
OK and one stylistic tweak by kristaps@.
Diffstat (limited to 'term.c')
-rw-r--r--term.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/term.c b/term.c
index 1585c1af..c41482ca 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.150 2010/06/26 15:36:37 kristaps Exp $ */
+/* $Id: term.c,v 1.151 2010/06/27 01:26:20 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -480,9 +480,14 @@ term_word(struct termp *p, const char *word)
}
if ( ! (TERMP_NOSPACE & p->flags)) {
- bufferc(p, ' ');
- if (TERMP_SENTENCE & p->flags)
+ if ( ! (TERMP_KEEP & p->flags)) {
+ if (TERMP_PREKEEP & p->flags)
+ p->flags |= TERMP_KEEP;
bufferc(p, ' ');
+ if (TERMP_SENTENCE & p->flags)
+ bufferc(p, ' ');
+ } else
+ bufferc(p, ASCII_NBRSP);
}
if ( ! (p->flags & TERMP_NONOSPACE))