aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index f0a452a..ee06d29 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -23,6 +23,8 @@ fn main() {
term.swap_buffers().unwrap();
let knockout_cell = Cell::with_style(Color::White, Color::Black, Attr::Default);
+ let red_cell = Cell::with_style(Color::White, Color::Red, Attr::Default);
+ let green_cell = Cell::with_style(Color::White, Color::Green, Attr::Default);
let mut selection = Point { x: 0, y: 2 };
@@ -73,7 +75,14 @@ fn main() {
}
}
'\x0D' => {
- clipboard_ctx.set_contents(strip_key(options[selection.y - 3]).to_owned()).unwrap()
+ match clipboard_ctx.set_contents(strip_key(options[selection.y - 3]).to_owned()) {
+ Ok(_) => {
+ term.printline_with_cell(selection.x, selection.y, "->", green_cell);
+ },
+ Err(_) => {
+ term.printline_with_cell(selection.x, selection.y, "->", red_cell);
+ }
+ }
}
c @ _ => {
}