aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/grid.rs5
-rw-r--r--src/term.rs14
2 files changed, 12 insertions, 7 deletions
diff --git a/src/grid.rs b/src/grid.rs
index f5c98afb..3b3acf9b 100644
--- a/src/grid.rs
+++ b/src/grid.rs
@@ -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,
}
}
diff --git a/src/term.rs b/src/term.rs
index a552ee5d..b25502f1 100644
--- a/src/term.rs
+++ b/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);
}