]> gitweb.factorcode.org Git - factor.git/commitdiff
io.streams.256color: simplify
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 29 Jan 2023 01:46:59 +0000 (17:46 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 29 Jan 2023 01:46:59 +0000 (17:46 -0800)
extra/io/streams/256color/256color.factor

index b18f673d6c62d84dde3c7091f6b070ccc4ba9c12..d0610275b9f122afb0dadba231559251d5ed6b60 100644 (file)
@@ -75,10 +75,10 @@ C: <256color> 256color
 M:: 256color stream-format ( str style stream -- )
     stream stream>> :> out
     style foreground of [ color>foreground out stream-write t ] [ f ] if*
-    style background of [ color>background out stream-write t ] [ f ] if*
-    style font-style of [ font-styles out stream-write t ] [ f ] if*
+    style background of [ color>background out stream-write drop t ] when*
+    style font-style of [ font-styles out stream-write drop t ] when*
     str out stream-write
-    or or [ "\e[0m" out stream-write ] when ;
+    [ "\e[0m" out stream-write ] when ;
 
 M: 256color make-span-stream
     swap <style-stream> <ignore-close-stream> ;