From 3bf8172b899cc7ea57b226848a9a8a3eec4d4db3 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Sat, 21 Sep 2024 20:57:24 -0300 Subject: [PATCH] fix: Terminal formatter was skipping things that it could highlight --- spec/tartrazine_spec.cr | 2 +- src/formatters/ansi.cr | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/tartrazine_spec.cr b/spec/tartrazine_spec.cr index b402cb8..55e239a 100644 --- a/spec/tartrazine_spec.cr +++ b/spec/tartrazine_spec.cr @@ -114,7 +114,7 @@ describe Tartrazine do ) else ansi.should eq( - "\e[38;2;171;70;66mputs\e[0m\e[38;2;216;216;216m \e[0m'Hello, World!'" + "\e[38;2;171;70;66mputs\e[0m\e[38;2;216;216;216m \e[0m\e[38;2;161;181;108m'Hello, World!'\e[0m" ) end end diff --git a/src/formatters/ansi.cr b/src/formatters/ansi.cr index 52b589c..fa9d0dd 100644 --- a/src/formatters/ansi.cr +++ b/src/formatters/ansi.cr @@ -34,8 +34,6 @@ module Tartrazine end def colorize(text : String, token : String) : String - style = theme.styles.fetch(token, nil) - return text if style.nil? if theme.styles.has_key?(token) s = theme.styles[token] else