Basic support for table ansi resets.
This commit is contained in:
parent
60850f60b0
commit
97dd257780
4 changed files with 18 additions and 10 deletions
|
@ -177,6 +177,7 @@
|
||||||
(list "" 1 2 3 4 5 6 7 8 9 10 11 12))
|
(list "" 1 2 3 4 5 6 7 8 9 10 11 12))
|
||||||
(member-calendar->years-table mc))))
|
(member-calendar->years-table mc))))
|
||||||
(table->string data
|
(table->string data
|
||||||
|
#:ansi-reset? #t
|
||||||
#:border '(((light #:top #:left none) (light #:top none) ... (light #:top #:right none))
|
#:border '(((light #:top #:left none) (light #:top none) ... (light #:top #:right none))
|
||||||
((light #:left none) light ... (light #:right none)) ...
|
((light #:left none) light ... (light #:right none)) ...
|
||||||
((light #:bottom #:left none) (light #:bottom none) ... (light #:bottom #:right none)))
|
((light #:bottom #:left none) (light #:bottom none) ... (light #:bottom #:right none)))
|
||||||
|
|
|
@ -143,7 +143,6 @@
|
||||||
(member-payments->table mr)
|
(member-payments->table mr)
|
||||||
(member-calendar->table mr))
|
(member-calendar->table mr))
|
||||||
)
|
)
|
||||||
#:ansi #t
|
|
||||||
#:row0-border #t
|
#:row0-border #t
|
||||||
#:col-border #t))
|
#:col-border #t))
|
||||||
(let* ((balance (member-balance mr))
|
(let* ((balance (member-balance mr))
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
(
|
(
|
||||||
table-rows-border
|
table-rows-border
|
||||||
|
|
||||||
|
make-table-vertical-sgr-block
|
||||||
|
|
||||||
table-border-vertical
|
table-border-vertical
|
||||||
|
|
||||||
table-border-between-rows?
|
table-border-between-rows?
|
||||||
|
|
|
@ -89,15 +89,21 @@
|
||||||
(res '())
|
(res '())
|
||||||
(prev-borders #f))
|
(prev-borders #f))
|
||||||
(if (null? rows)
|
(if (null? rows)
|
||||||
(apply append
|
(let ((res0 (apply append
|
||||||
(reverse (if (table-border-between-rows? prev-borders #f)
|
(reverse (if (table-border-between-rows? prev-borders #f)
|
||||||
(cons (table-rows-border col-widths
|
(cons (table-rows-border col-widths
|
||||||
prev-borders
|
prev-borders
|
||||||
#f
|
#f
|
||||||
col-separators
|
col-separators
|
||||||
unicode?)
|
unicode?)
|
||||||
res)
|
res)
|
||||||
res)))
|
res)))))
|
||||||
|
(if ansi-reset?
|
||||||
|
(sgr-block-happend res0
|
||||||
|
(make-table-vertical-sgr-block
|
||||||
|
(sgr-block-height res0)
|
||||||
|
"\x1b[0m"))
|
||||||
|
res0))
|
||||||
(loop (cdr rows)
|
(loop (cdr rows)
|
||||||
(cdr borders)
|
(cdr borders)
|
||||||
(if (table-border-between-rows? prev-borders (car borders))
|
(if (table-border-between-rows? prev-borders (car borders))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue