0 | module Text.PrettyPrint.Bernardy.Core.ANSI
3 | import Text.PrettyPrint.Bernardy.Core
9 | reset = escapeSGR [Reset]
13 | -> (ss : SnocList String)
14 | -> {auto 0 prf : NonEmptySnoc ss}
15 | -> Subset (SnocList String) NonEmptySnoc
16 | decorateImpl s [<x] = Element [<s ++ x ++ reset] %search
17 | decorateImpl s (sx :< x) = Element (go [] sx :< (x ++ reset)) %search
19 | go : List String -> SnocList String -> SnocList String
20 | go strs [< x] = [< s ++ x] <>< strs
21 | go strs (sx :< x) = go (x :: strs) sx
22 | go strs [<] = [<] <>< strs
27 | decorateLayout : List SGR -> Layout -> Layout
28 | decorateLayout [] l = l
29 | decorateLayout xs (MkLayout content stats) =
30 | layout (decorateImpl (escapeSGR xs) content) stats