aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-14 23:24:17 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-14 23:24:17 +0000
commit0fa63c17427ebc9bb3803ef77f6d3adff71a6e9a (patch)
tree780ebe3cb39ac7535534ca79d4301a696a1b0633 /term.c
parenta5cb8b874ed422ba6f202f5cd0dc73e4689e168b (diff)
downloadmandoc-0fa63c17427ebc9bb3803ef77f6d3adff71a6e9a.tar.gz
mandoc-0fa63c17427ebc9bb3803ef77f6d3adff71a6e9a.tar.zst
mandoc-0fa63c17427ebc9bb3803ef77f6d3adff71a6e9a.zip
implement so-called absolute horizontal motion: \h'|...',
used for example by zoem(1)
Diffstat (limited to 'term.c')
-rw-r--r--term.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/term.c b/term.c
index 71fd73d5..595390b6 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.272 2017/06/14 18:23:37 schwarze Exp $ */
+/* $Id: term.c,v 1.273 2017/06/14 23:24:18 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -526,9 +526,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);