source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Count trailing escaped blanks correctly;  those ruined the
@ 2010-09-23 20:26 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2010-09-23 20:26 UTC (permalink / raw)
  To: source

Log Message:
-----------
Count trailing escaped blanks correctly; 
those ruined the alignment of columns.
Tested by jmc@, and kristaps@ agrees with the direction.

Modified Files:
--------------
    mdocml:
        term.c

Revision Data
-------------
Index: term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term.c,v
retrieving revision 1.171
retrieving revision 1.172
diff -Lterm.c -Lterm.c -u -p -r1.171 -r1.172
--- term.c
+++ term.c
@@ -134,6 +134,7 @@ term_flushln(struct termp *p)
 	size_t		 vbl;   /* number of blanks to prepend to output */
 	size_t		 vend;	/* end of word visual position on output */
 	size_t		 bp;    /* visual right border position */
+	size_t		 dv;    /* temporary for visual pos calculations */
 	int		 j;     /* temporary loop index for p->buf */
 	int		 jhy;	/* last hyph before overflow w/r/t j */
 	size_t		 maxvis; /* output position of visible boundary */
@@ -237,7 +238,9 @@ term_flushln(struct termp *p)
 				j = i;
 				while (' ' == p->buf[i])
 					i++;
-				vbl += (i - j) * (*p->width)(p, ' ');
+				dv = (i - j) * (*p->width)(p, ' ');
+				vbl += dv;
+				vend += dv;
 				break;
 			}
 			if (ASCII_NBRSP == p->buf[i]) {
@@ -264,7 +267,6 @@ term_flushln(struct termp *p)
 				p->viscol += (*p->width)(p, p->buf[i]);
 			}
 		}
-		vend += vbl;
 		vis = vend;
 	}
 
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-09-23 20:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-23 20:26 mdocml: Count trailing escaped blanks correctly; those ruined the schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).