From a8c51a7fd89f55b9f88e7f100138381d0e99e5b9 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 6 Mar 2015 11:03:03 +0000 Subject: Flush the line preceding a table before clearing the right margin, such that that line isn't output with unlimited width. Problem reported and fix OK by kristaps@. --- tbl_term.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tbl_term.c') diff --git a/tbl_term.c b/tbl_term.c index a6354b51..c4702a16 100644 --- a/tbl_term.c +++ b/tbl_term.c @@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.38 2015/01/31 00:12:41 schwarze Exp $ */ +/* $Id: tbl_term.c,v 1.39 2015/03/06 11:03:03 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2014, 2015 Ingo Schwarze @@ -66,6 +66,9 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) size_t rmargin, maxrmargin, tsz; int ic, horiz, spans, vert; + if (tp->tbl.cols == NULL) + term_flushln(tp); + rmargin = tp->rmargin; maxrmargin = tp->maxrmargin; @@ -82,8 +85,6 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) */ if (tp->tbl.cols == NULL) { - term_flushln(tp); - tp->tbl.len = term_tbl_len; tp->tbl.slen = term_tbl_strlen; tp->tbl.arg = tp; -- cgit v1.2.3