summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TODO3
-rw-r--r--term.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/TODO b/TODO
index 3a1c07e6..89525db0 100644
--- a/TODO
+++ b/TODO
@@ -169,9 +169,6 @@
so far, we only have it in roff(7) and man(7)
reminded by millert@ Thu, 09 Dec 2010 17:29:52 -0500
-- perl(1) SYNOPSIS looks bad; reported by deraadt@
- 1) man(7) seems to need SYNOPSIS .Nm blocks, too
-
- In .Bl -column,
.It Em Authentication<tab>Key Length
ought to render "Key Length" with emphasis, too,
diff --git a/term.c b/term.c
index 161cdadb..9e28f29c 100644
--- a/term.c
+++ b/term.c
@@ -106,6 +106,7 @@ void
term_flushln(struct termp *p)
{
int i; /* current input position in p->buf */
+ int ntab; /* number of tabs to prepend */
size_t vis; /* current visual position on output */
size_t vbl; /* number of blanks to prepend to output */
size_t vend; /* end of word visual position on output */
@@ -144,10 +145,12 @@ term_flushln(struct termp *p)
* Handle literal tab characters: collapse all
* subsequent tabs into a single huge set of spaces.
*/
+ ntab = 0;
while (i < p->col && '\t' == p->buf[i]) {
vend = (vis / p->tabwidth + 1) * p->tabwidth;
vbl += vend - vis;
vis = vend;
+ ntab++;
i++;
}
@@ -192,6 +195,11 @@ term_flushln(struct termp *p)
} else
vbl = p->offset;
+ /* use pending tabs on the new line */
+
+ if (0 < ntab)
+ vbl += ntab * p->tabwidth;
+
/* Remove the p->overstep width. */
bp += (size_t)p->overstep;