summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-06-14 23:23:52 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-06-14 23:23:52 +0000
commitd85e2a30153fda2c6076da0ced09ab2e6f928d48 (patch)
tree6ddfbdf3b8eac4860c5d633c2a5ddc1d837c5cb3 /usr.bin/mandoc/term.c
parent73f02f010c9859d465642793bb2c4dd4a9434c74 (diff)
implement so-called absolute horizontal motion: \h'|...',
used for example by zoem(1)
Diffstat (limited to 'usr.bin/mandoc/term.c')
-rw-r--r--usr.bin/mandoc/term.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/mandoc/term.c b/usr.bin/mandoc/term.c
index 0f59fdc5439..0970f6835b0 100644
--- a/usr.bin/mandoc/term.c
+++ b/usr.bin/mandoc/term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: term.c,v 1.132 2017/06/14 18:23:26 schwarze Exp $ */
+/* $OpenBSD: term.c,v 1.133 2017/06/14 23:23:51 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -524,9 +524,14 @@ term_word(struct termp *p, const char *word)
p->flags |= (TERMP_NOSPACE | TERMP_NONEWLINE);
continue;
case ESCAPE_HORIZ:
+ if (*seq == '|') {
+ seq++;
+ uc = -p->col;
+ } else
+ uc = 0;
if (a2roffsu(seq, &su, SCALE_EM) == NULL)
continue;
- uc = term_hen(p, &su);
+ uc += term_hen(p, &su);
if (uc > 0)
while (uc-- > 0)
bufferc(p, ASCII_NBRSP);