source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: As noticed by kristaps@, when breaking an overflowing line,
@ 2011-09-21  9:57 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2011-09-21  9:57 UTC (permalink / raw)
  To: source

Log Message:
-----------
As noticed by kristaps@, when breaking an overflowing line,
forget about pending whitespace (vbl), or the next line would
be misaligned and potentially too long; but i'm fixing this
in a simpler way than he proposed.
Also remove the kludges in .HP that compensated for this bug.

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

Revision Data
-------------
Index: term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term.c,v
retrieving revision 1.200
retrieving revision 1.201
diff -Lterm.c -Lterm.c -u -p -r1.200 -r1.201
--- term.c
+++ term.c
@@ -184,14 +184,12 @@ term_flushln(struct termp *p)
 		if (vend > bp && 0 == jhy && vis > 0) {
 			vend -= vis;
 			(*p->endline)(p);
+			p->viscol = 0;
 			if (TERMP_NOBREAK & p->flags) {
-				p->viscol = p->rmargin;
-				(*p->advance)(p, p->rmargin);
+				vbl = p->rmargin;
 				vend += p->rmargin - p->offset;
-			} else {
-				p->viscol = 0;
+			} else
 				vbl = p->offset;
-			}
 
 			/* Remove the p->overstep width. */
 
Index: man_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_term.c,v
retrieving revision 1.120
retrieving revision 1.121
diff -Lman_term.c -Lman_term.c -u -p -r1.120 -r1.121
--- man_term.c
+++ man_term.c
@@ -251,7 +251,7 @@ pre_literal(DECL_ARGS)
 	 * indentation has to be set up explicitly.
 	 */
 	if (MAN_HP == n->parent->tok && p->rmargin < p->maxrmargin) {
-		p->offset = p->rmargin + 1;
+		p->offset = p->rmargin;
 		p->rmargin = p->maxrmargin;
 		p->flags &= ~(TERMP_NOBREAK | TERMP_TWOSPACE);
 		p->flags |= TERMP_NOSPACE;
@@ -469,9 +469,7 @@ pre_HP(DECL_ARGS)
 			len = (size_t)ival;
 
 	one = term_len(p, 1);
-	if (len > one)
-		len -= one;
-	else
+	if (len < one)
 		len = one;
 
 	p->offset = mt->offset;
--
 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:[~2011-09-21  9:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-21  9:57 mdocml: As noticed by kristaps@, when breaking an overflowing line, 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).