diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-12 20:45:18 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-12 20:45:18 +0000 |
commit | 7f9e8c632ffa743b8770302690cf8c9e17017d83 (patch) | |
tree | 9a7ed38bb7614276c0d79e39faa3eede615d2ebc /tbl_term.c | |
parent | b9afab5e3f173e16ac169b27fa39efd01ea9afe7 (diff) | |
download | mandoc-7f9e8c632ffa743b8770302690cf8c9e17017d83.tar.gz mandoc-7f9e8c632ffa743b8770302690cf8c9e17017d83.tar.zst mandoc-7f9e8c632ffa743b8770302690cf8c9e17017d83.zip |
implement the tbl(7) "allbox" option;
used for example by curs_getch(3) and GLwDrawingArea(3)
Diffstat (limited to 'tbl_term.c')
-rw-r--r-- | tbl_term.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.48 2017/06/12 20:14:18 schwarze Exp $ */ +/* $Id: tbl_term.c,v 1.49 2017/06/12 20:45:18 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011,2012,2014,2015,2017 Ingo Schwarze <schwarze@openbsd.org> @@ -242,6 +242,8 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) cp = cp->next; } else vert = 0; + if (sp->opts->opts & TBL_OPT_ALLBOX) + vert = 1; if (vert == 0) continue; @@ -300,7 +302,9 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) free(tp->tbl.cols); tp->tbl.cols = NULL; tp->tcol->offset = offset; - } + } else if (horiz == 0 && sp->opts->opts & TBL_OPT_ALLBOX) + tbl_hrule(tp, sp, 1); + tp->flags &= ~TERMP_NONOSPACE; } @@ -336,6 +340,8 @@ tbl_hrule(struct termp *tp, const struct tbl_span *sp, int kind) vert = c2->vert; c2 = c2->next; } + if (sp->opts->opts & TBL_OPT_ALLBOX && !vert) + vert = 1; if (vert) tbl_char(tp, cross, vert); if (vert < 2) |