Minor fixes to make initializing the terminal more consistent and to remove a magic number for wall limits.
This commit is contained in:
parent
2d5490131d
commit
ae43dad499
12 changed files with 47 additions and 42 deletions
|
@ -109,10 +109,6 @@ 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(std::wstring_view codes, ColorCB color_cb, WriteCB write_cb) {
|
||||
|
@ -127,14 +123,14 @@ bool ANSIParser::parse(std::wstring_view codes, ColorCB color_cb, WriteCB write_
|
|||
sf::Color* target = &color;
|
||||
|
||||
|
||||
#line 122 "ansi_parser.cpp"
|
||||
#line 118 "ansi_parser.cpp"
|
||||
{
|
||||
cs = ansi_parser_start;
|
||||
}
|
||||
|
||||
#line 149 "ansi_parser.rl"
|
||||
#line 145 "ansi_parser.rl"
|
||||
|
||||
#line 125 "ansi_parser.cpp"
|
||||
#line 121 "ansi_parser.cpp"
|
||||
{
|
||||
int _klen;
|
||||
unsigned int _trans;
|
||||
|
@ -325,7 +321,7 @@ _match:
|
|||
#line 85 "ansi_parser.rl"
|
||||
{}
|
||||
break;
|
||||
#line 298 "ansi_parser.cpp"
|
||||
#line 294 "ansi_parser.cpp"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,7 +341,7 @@ _again:
|
|||
#line 85 "ansi_parser.rl"
|
||||
{}
|
||||
break;
|
||||
#line 316 "ansi_parser.cpp"
|
||||
#line 312 "ansi_parser.cpp"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -353,7 +349,7 @@ _again:
|
|||
_out: {}
|
||||
}
|
||||
|
||||
#line 150 "ansi_parser.rl"
|
||||
#line 146 "ansi_parser.rl"
|
||||
|
||||
bool good = pe - p == 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue