Permalink
Browse files

underline and standout

  • Loading branch information...
1 parent 65b07a4 commit 124387cf2f1aa86e4ca8ac821d7f3c80f527eed4 @doy committed Apr 2, 2013
Showing with 26 additions and 0 deletions.
  1. +26 −0 src/term.rs
View
26 src/term.rs
@@ -80,6 +80,14 @@ impl Term {
self.w.reset_color();
}
+ pub fn underline (&mut self, enabled: bool) {
+ self.w.underline(enabled);
+ }
+
+ pub fn standout (&mut self, enabled: bool) {
+ self.w.standout(enabled);
+ }
+
pub fn cursor (&mut self, enabled: bool) {
self.w.cursor(enabled);
}
@@ -137,6 +145,24 @@ impl Writer {
self.buf.push_str(escape("op"));
}
+ fn underline (&mut self, enabled: bool) {
+ if enabled {
+ self.buf.push_str(escape("smul"));
+ }
+ else {
+ self.buf.push_str(escape("rmul"));
+ }
+ }
+
+ fn standout (&mut self, enabled: bool) {
+ if enabled {
+ self.buf.push_str(escape("smso"));
+ }
+ else {
+ self.buf.push_str(escape("rmso"));
+ }
+ }
+
fn cursor (&mut self, enabled: bool) {
if enabled {
self.buf.push_str(escape("civis"));

0 comments on commit 124387c

Please sign in to comment.