Have to tweak when to test that true color is set, and also when to do it for the test.
This commit is contained in:
parent
707e9e3d6e
commit
f223257aad
2 changed files with 18 additions and 13 deletions
|
@ -87,12 +87,16 @@ static const int foo_en_main = 19;
|
|||
|
||||
#line 84 "ansi_parser.rl"
|
||||
|
||||
#include <ftxui/screen/terminal.hpp>
|
||||
|
||||
ANSIParser::ANSIParser(sf::Color default_fg, sf::Color default_bg) :
|
||||
$default_fg(default_fg),
|
||||
$default_bg(default_bg)
|
||||
{
|
||||
|
||||
// the parser only handles full color so force it
|
||||
if(ftxui::Terminal::ColorSupport() != ftxui::Terminal::Color::TrueColor) {
|
||||
ftxui::Terminal::SetColorSupport(ftxui::Terminal::Color::TrueColor);
|
||||
}
|
||||
}
|
||||
|
||||
bool ANSIParser::parse(const std::string &screen, WriteCB write) {
|
||||
|
@ -112,14 +116,14 @@ bool ANSIParser::parse(std::wstring_view codes, WriteCB write) {
|
|||
sf::Color &target = color;
|
||||
|
||||
|
||||
#line 107 "ansi_parser.cpp"
|
||||
#line 111 "ansi_parser.cpp"
|
||||
{
|
||||
cs = foo_start;
|
||||
}
|
||||
|
||||
#line 110 "ansi_parser.rl"
|
||||
#line 114 "ansi_parser.rl"
|
||||
|
||||
#line 110 "ansi_parser.cpp"
|
||||
#line 114 "ansi_parser.cpp"
|
||||
{
|
||||
int _klen;
|
||||
unsigned int _trans;
|
||||
|
@ -272,7 +276,7 @@ _match:
|
|||
#line 59 "ansi_parser.rl"
|
||||
{ }
|
||||
break;
|
||||
#line 249 "ansi_parser.cpp"
|
||||
#line 253 "ansi_parser.cpp"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -292,7 +296,7 @@ _again:
|
|||
#line 59 "ansi_parser.rl"
|
||||
{ }
|
||||
break;
|
||||
#line 267 "ansi_parser.cpp"
|
||||
#line 271 "ansi_parser.cpp"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -300,7 +304,7 @@ _again:
|
|||
_out: {}
|
||||
}
|
||||
|
||||
#line 111 "ansi_parser.rl"
|
||||
#line 115 "ansi_parser.rl"
|
||||
|
||||
return p - pe == 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue