properly handles unknown ansi escapes by adding them as plain text

This commit is contained in:
David Bittner
2019-05-02 23:04:41 -04:00
parent c1764f73ab
commit b1c17325f7
4 changed files with 30 additions and 65 deletions

View File

@@ -207,8 +207,11 @@ impl<'a> Iterator for ParserIterator<'a> {
self.dat = &ret.0;
Some(ret.1)
}else{
let pos = self.dat[loc..].find('\x1b');
let pos = self.dat[(loc+1)..].find('\u{1b}');
if let Some(loc) = pos {
//Added to because it's based one character ahead
let loc = loc+1;
let temp = &self.dat[..loc];
self.dat = &self.dat[loc..];