diff options
Diffstat (limited to 'roff_term.c')
-rw-r--r-- | roff_term.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/roff_term.c b/roff_term.c index 59de74fc..5a838ea2 100644 --- a/roff_term.c +++ b/roff_term.c @@ -32,6 +32,7 @@ static void roff_term_pre_ce(ROFF_TERM_ARGS); static void roff_term_pre_ft(ROFF_TERM_ARGS); static void roff_term_pre_ll(ROFF_TERM_ARGS); static void roff_term_pre_mc(ROFF_TERM_ARGS); +static void roff_term_pre_po(ROFF_TERM_ARGS); static void roff_term_pre_sp(ROFF_TERM_ARGS); static void roff_term_pre_ta(ROFF_TERM_ARGS); static void roff_term_pre_ti(ROFF_TERM_ARGS); @@ -42,6 +43,7 @@ static const roff_term_pre_fp roff_term_pre_acts[ROFF_MAX] = { roff_term_pre_ft, /* ft */ roff_term_pre_ll, /* ll */ roff_term_pre_mc, /* mc */ + roff_term_pre_po, /* po */ roff_term_pre_ce, /* rj */ roff_term_pre_sp, /* sp */ roff_term_pre_ta, /* ta */ @@ -153,6 +155,28 @@ roff_term_pre_mc(ROFF_TERM_ARGS) } static void +roff_term_pre_po(ROFF_TERM_ARGS) +{ + struct roffsu su; + static int po, polast; + int ponew; + + if (n->child != NULL && + a2roffsu(n->child->string, &su, SCALE_EM) != NULL) { + ponew = term_hen(p, &su); + if (*n->child->string == '+' || + *n->child->string == '-') + ponew += po; + } else + ponew = polast; + polast = po; + po = ponew; + + ponew = po - polast + (int)p->tcol->offset; + p->tcol->offset = ponew > 0 ? ponew : 0; +} + +static void roff_term_pre_sp(ROFF_TERM_ARGS) { struct roffsu su; |