Terminal sets more attributes on grid Cells
This commit is contained in:
parent
263a4e8a2e
commit
1a7eda7b05
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
14
src/term.rs
14
src/term.rs
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue