Prepare for ANSI resets.
This commit is contained in:
parent
0806be2420
commit
60850f60b0
2 changed files with 13 additions and 8 deletions
|
@ -134,17 +134,21 @@
|
||||||
(cdr cws)
|
(cdr cws)
|
||||||
(cdr col-seps)))))))
|
(cdr col-seps)))))))
|
||||||
|
|
||||||
|
;; Universal block maker
|
||||||
|
(define (make-table-vertical-sgr-block height str)
|
||||||
|
(let loop ((height height)
|
||||||
|
(res '()))
|
||||||
|
(if (= height 0)
|
||||||
|
res
|
||||||
|
(loop (sub1 height)
|
||||||
|
(cons (list 0 (cons str 1))
|
||||||
|
res)))))
|
||||||
|
|
||||||
;; Returns a SGR-block of correct height
|
;; Returns a SGR-block of correct height
|
||||||
(define* (table-border-vertical height left-borders right-borders (unicode? #t))
|
(define* (table-border-vertical height left-borders right-borders (unicode? #t))
|
||||||
(let* ((ch (table-border-char-horizontal left-borders right-borders unicode?))
|
(let* ((ch (table-border-char-horizontal left-borders right-borders unicode?))
|
||||||
(str (utf8-char->string ch)))
|
(str (utf8-char->string ch)))
|
||||||
(let loop ((height height)
|
(make-table-vertical-sgr-block height str)))
|
||||||
(res '()))
|
|
||||||
(if (= height 0)
|
|
||||||
res
|
|
||||||
(loop (sub1 height)
|
|
||||||
(cons (list 0 (cons str 1))
|
|
||||||
res))))))
|
|
||||||
|
|
||||||
;; Returns true if the border should be drawn between these two rows
|
;; Returns true if the border should be drawn between these two rows
|
||||||
(define (table-border-between-rows? row0 row1)
|
(define (table-border-between-rows? row0 row1)
|
||||||
|
|
|
@ -75,7 +75,8 @@
|
||||||
#:border (border-spec '((none ...) ...))
|
#:border (border-spec '((none ...) ...))
|
||||||
#:widths (widths-spec '(0 ...))
|
#:widths (widths-spec '(0 ...))
|
||||||
#:width (width #f)
|
#:width (width #f)
|
||||||
#:unicode? (unicode? (eq? (*table-border-style*) 'unicode)))
|
#:unicode? (unicode? (eq? (*table-border-style*) 'unicode))
|
||||||
|
#:ansi-reset? (ansi-reset? #f))
|
||||||
(let-values (((ptbl col-widths)
|
(let-values (((ptbl col-widths)
|
||||||
(table-prepare tbl width widths-spec)))
|
(table-prepare tbl width widths-spec)))
|
||||||
(let* ((num-columns (length (car tbl)))
|
(let* ((num-columns (length (car tbl)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue