summaryrefslogtreecommitdiffstats
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
commitff7404ec88115f451afc869f7330722a3bb3e41e (patch)
treeae95f711969058cac81ed938895bd934f5503359 /term.c
parent91f0f16f2181a2ac79aecf7026518b21cf15770f (diff)
downloadmandoc-ff7404ec88115f451afc869f7330722a3bb3e41e.tar.gz
implement so-called absolute horizontal motion: \h'|...',
used for example by zoem(1)
Diffstat (limited to 'term.c')
-rw-r--r--term.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/term.c b/term.c
index 076dc033..6d8cf9a3 100644
--- a/term.c
+++ b/term.c
@@ -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);