Compare commits

..

2 commits

View file

@ -51,7 +51,7 @@
(define (style->sequence style port)
(define str (style-string style))
(define (just-str) (format port "~a" str))
(define (just-str) (display str port))
;; Color sequences aren't strings, so handle them specially
;; Colors don't get resolved until we have the port because we don't know the color profile until then.
@ -72,12 +72,18 @@
(define (cons-seq stylish sequence)
(match stylish
((? string? str) (make-style str (list sequence)))
((style) (cons-seq style sequence))
((? list? l) (make-style-node (map (cut cons-seq <> sequence) l)))
((? style? style) (set-style-sequences style (cons* sequence (style-sequences style))))
((? string? str)
(make-style str (list sequence)))
((style)
(cons-seq style sequence))
((? list? l)
(make-style-node (map (cut cons-seq <> sequence) l)))
((? style? style)
(set-style-sequences style
(cons* sequence (style-sequences style))))
((? style-node? node)
(set-style-node-children node (map (cut cons-seq <> sequence) (style-node-children node))))))
(set-style-node-children node
(map (cut cons-seq <> sequence) (style-node-children node))))))
(define (bold . s) (cons-seq s %BOLD))
(define (faint . s) (cons-seq s %FAINT))