Allow stripping SGR from sgr-list.
This commit is contained in:
parent
870335c637
commit
2041fef742
1 changed files with 5 additions and 2 deletions
|
@ -208,7 +208,8 @@
|
|||
;; Converts a SGR list into a single string
|
||||
(define* (sgr-list->string lst
|
||||
(initial-state empty-sgr-state)
|
||||
#:reset-state (reset-state #f))
|
||||
#:reset-state (reset-state #f)
|
||||
#:strip-ansi? (strip-ansi? #f))
|
||||
(let loop ((lst lst)
|
||||
(res '())
|
||||
(state initial-state))
|
||||
|
@ -221,7 +222,9 @@
|
|||
(let ((token (car lst)))
|
||||
(if (sgr-state? token)
|
||||
(loop (cdr lst)
|
||||
(cons (sgr-state-change->string state token) res)
|
||||
(if strip-ansi?
|
||||
res
|
||||
(cons (sgr-state-change->string state token) res))
|
||||
token)
|
||||
(loop (cdr lst)
|
||||
(cons (car token) res)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue