=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.240 retrieving revision 1.243 diff -u -p -r1.240 -r1.243 --- mandoc/term.c 2014/12/23 13:48:57 1.240 +++ mandoc/term.c 2015/01/21 20:33:25 1.243 @@ -1,7 +1,7 @@ -/* $Id: term.c,v 1.240 2014/12/23 13:48:57 schwarze Exp $ */ +/* $Id: term.c,v 1.243 2015/01/21 20:33:25 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2010-2014 Ingo Schwarze + * Copyright (c) 2010-2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -273,7 +273,7 @@ term_flushln(struct termp *p) } if (TERMP_HANG & p->flags) { - p->overstep = (int)(vis - maxvis + + p->overstep += (int)(p->offset + vis - p->rmargin + p->trailspace * (*p->width)(p, ' ')); /* @@ -495,6 +495,17 @@ term_word(struct termp *p, const char *word) case ESCAPE_SKIPCHAR: p->flags |= TERMP_SKIPCHAR; continue; + case ESCAPE_OVERSTRIKE: + cp = seq + sz; + while (seq < cp) { + if (*seq == '\\') { + mandoc_escape(&seq, NULL, NULL); + continue; + } + encode1(p, *seq++); + if (seq < cp) + encode(p, "\b", 1); + } default: continue; } @@ -716,6 +727,20 @@ term_strlen(const struct termp *p, const char *cp) case ESCAPE_SKIPCHAR: skip = 1; continue; + case ESCAPE_OVERSTRIKE: + rsz = 0; + rhs = seq + ssz; + while (seq < rhs) { + if (*seq == '\\') { + mandoc_escape(&seq, NULL, NULL); + continue; + } + i = (*p->width)(p, *seq++); + if (rsz < i) + rsz = i; + } + sz += rsz; + continue; default: continue; } @@ -773,6 +798,7 @@ int term_vspan(const struct termp *p, const struct roffsu *su) { double r; + int ri; switch (su->unit) { case SCALE_BU: @@ -808,7 +834,8 @@ term_vspan(const struct termp *p, const struct roffsu abort(); /* NOTREACHED */ } - return(r > 0.0 ? r + 0.4995 : r - 0.4995); + ri = r > 0.0 ? r + 0.4995 : r - 0.4995; + return(ri < 66 ? ri : 1); } int