Terminal sets more attributes on grid Cells

This commit is contained in:
Joe Wilm 2016-06-06 17:43:14 -07:00
parent 263a4e8a2e
commit 1a7eda7b05
No known key found for this signature in database
GPG Key ID: 39B57C6972F518DA
2 changed files with 12 additions and 7 deletions

View File

@ -24,7 +24,10 @@ pub struct Cell {
bitflags! {
pub flags CellFlags: u32 {
const INVERSE = 0b00000001,
const INVERSE = 0b00000001,
const BOLD = 0b00000010,
const ITALIC = 0b00000100,
const UNDERLINE = 0b00001000,
}
}

View File

@ -355,12 +355,14 @@ impl ansi::Handler for Term {
self.bg = DEFAULT_BG;
self.attr = CellFlags::empty();
},
Attr::Reverse => {
self.attr.insert(grid::INVERSE);
},
Attr::CancelReverse => {
self.attr.remove(grid::INVERSE);
},
Attr::Reverse => self.attr.insert(grid::INVERSE),
Attr::CancelReverse => self.attr.remove(grid::INVERSE),
Attr::Bold => self.attr.insert(grid::BOLD),
Attr::CancelBoldDim => self.attr.remove(grid::BOLD),
Attr::Italic => self.attr.insert(grid::ITALIC),
Attr::CancelItalic => self.attr.remove(grid::ITALIC),
Attr::Underscore => self.attr.insert(grid::UNDERLINE),
Attr::CancelUnderline => self.attr.remove(grid::UNDERLINE),
_ => {
println!("Term got unhandled attr: {:?}", attr);
}