Fix parsing of coalesced SGR attributes

cc #116
This commit is contained in:
Joe Wilm 2017-01-08 16:35:59 -08:00
parent 9e713189cc
commit b7f43ac023
1 changed files with 6 additions and 2 deletions

View File

@ -627,7 +627,9 @@ impl<'a, H, W> vte::Perform for Performer<'a, H, W>
36 => Attr::Foreground(Color::Named(NamedColor::Cyan)), 36 => Attr::Foreground(Color::Named(NamedColor::Cyan)),
37 => Attr::Foreground(Color::Named(NamedColor::White)), 37 => Attr::Foreground(Color::Named(NamedColor::White)),
38 => { 38 => {
if let Some(color) = parse_color(&args[i..], &mut i) { let mut start = 0;
if let Some(color) = parse_color(&args[i..], &mut start) {
i += start;
Attr::Foreground(color) Attr::Foreground(color)
} else { } else {
break; break;
@ -643,7 +645,9 @@ impl<'a, H, W> vte::Perform for Performer<'a, H, W>
46 => Attr::Background(Color::Named(NamedColor::Cyan)), 46 => Attr::Background(Color::Named(NamedColor::Cyan)),
47 => Attr::Background(Color::Named(NamedColor::White)), 47 => Attr::Background(Color::Named(NamedColor::White)),
48 => { 48 => {
if let Some(color) = parse_color(&args[i..], &mut i) { let mut start = 0;
if let Some(color) = parse_color(&args[i..], &mut start) {
i += start;
Attr::Background(color) Attr::Background(color)
} else { } else {
break; break;