Finish alignment.
This commit is contained in:
parent
3f50d85412
commit
965b0432fa
4 changed files with 19 additions and 5 deletions
5
ansi.scm
5
ansi.scm
|
@ -127,7 +127,10 @@
|
|||
;; 1 - seen escape
|
||||
;; 2 - CSI started
|
||||
(define (ansi-string-length str)
|
||||
(let loop ((lst (irregex-extract (irregex "." 'u) str))
|
||||
(let loop ((lst (irregex-extract (irregex "." 'u)
|
||||
(irregex-replace (irregex "\t$" 'u)
|
||||
(irregex-replace (irregex "^\t" 'u)
|
||||
str))))
|
||||
(state 0)
|
||||
(len 0))
|
||||
(if (null? lst)
|
||||
|
|
|
@ -26,6 +26,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
")
|
||||
|
||||
(import testing
|
||||
(chicken format)
|
||||
listing
|
||||
dictionary
|
||||
month
|
||||
|
@ -136,7 +137,9 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
(let* ((mc (member-calendar mr))
|
||||
(fees (member-calendar->fees mc)))
|
||||
(print-member-table mr)
|
||||
(print (table->string (cons (list "" 1 2 3 4 5 6 7 8 9 10 11 12)
|
||||
(print (table->string (cons (map (lambda (c)
|
||||
(sprintf "\t~A\t" c))
|
||||
(list "" 1 2 3 4 5 6 7 8 9 10 11 12))
|
||||
(member-calendar->years-table mc))
|
||||
#:table-border #t
|
||||
#:row-border #t
|
||||
|
|
|
@ -332,7 +332,7 @@
|
|||
;; Helper function for pretty-formatting the filtered members lists
|
||||
;; in a table.
|
||||
(define (members-table-row a:? label mrs fmt)
|
||||
(list (string-append a:? label)
|
||||
(list (string-append "\t" a:? label)
|
||||
(length mrs)
|
||||
(ansi-paragraph-format
|
||||
(member-records->string
|
||||
|
|
12
table.scm
12
table.scm
|
@ -150,8 +150,16 @@
|
|||
(if (< len w)
|
||||
(let* ((miss (- w len))
|
||||
(do-left-pad first-tab)
|
||||
(do-right-pad (or (not first-tab) last-tab)))
|
||||
(string-append line1 (string-repeat " " miss)))
|
||||
(do-right-pad (or (not first-tab) last-tab))
|
||||
(left-pad-len (if do-left-pad
|
||||
(if do-right-pad
|
||||
(- miss (quotient miss 2))
|
||||
miss)
|
||||
0))
|
||||
(right-pad-len (- miss left-pad-len))
|
||||
(left-pad (make-string left-pad-len #\space))
|
||||
(right-pad (make-string right-pad-len #\space)))
|
||||
(string-append left-pad line1 right-pad))
|
||||
line1)))
|
||||
|
||||
;; Pads all lines of this cell to required width
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue