summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tbl_term.c8
-rw-r--r--term.c7
-rw-r--r--term.h1
3 files changed, 12 insertions, 4 deletions
diff --git a/tbl_term.c b/tbl_term.c
index 94f6ecc3..7d28711f 100644
--- a/tbl_term.c
+++ b/tbl_term.c
@@ -171,10 +171,14 @@ term_tbl(struct termp *tp, const struct tbl_span *sp)
if (TBL_SPAN_LAST & sp->flags) {
if (TBL_OPT_DBOX & sp->tbl->opts ||
- TBL_OPT_BOX & sp->tbl->opts)
+ TBL_OPT_BOX & sp->tbl->opts) {
tbl_hframe(tp, sp, 0);
- if (TBL_OPT_DBOX & sp->tbl->opts)
+ tp->skipvsp = 1;
+ }
+ if (TBL_OPT_DBOX & sp->tbl->opts) {
tbl_hframe(tp, sp, 1);
+ tp->skipvsp = 2;
+ }
assert(tp->tbl.cols);
free(tp->tbl.cols);
tp->tbl.cols = NULL;
diff --git a/term.c b/term.c
index 6a8672de..889f72af 100644
--- a/term.c
+++ b/term.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -316,7 +316,10 @@ term_vspace(struct termp *p)
term_newln(p);
p->viscol = 0;
- (*p->endline)(p);
+ if (0 < p->skipvsp)
+ p->skipvsp--;
+ else
+ (*p->endline)(p);
}
void
diff --git a/term.h b/term.h
index 8d8554cb..ce1b4ed5 100644
--- a/term.h
+++ b/term.h
@@ -63,6 +63,7 @@ struct termp {
int col; /* Bytes in buf. */
size_t viscol; /* Chars on current line. */
int overstep; /* See termp_flushln(). */
+ int skipvsp; /* Vertical space to skip. */
int flags;
#define TERMP_SENTENCE (1 << 1) /* Space before a sentence. */
#define TERMP_NOSPACE (1 << 2) /* No space before words. */