aboutsummaryrefslogtreecommitdiff
path: root/src/app/impl_view.rs
diff options
context:
space:
mode:
authornc <[email protected]>2020-08-06 03:08:51 +0100
committernc <[email protected]>2020-08-06 03:08:51 +0100
commitee9be05579d87ca99f153d20995af3273385b564 (patch)
tree2760e96aea8d22ef9646918441c0ca7fb752b915 /src/app/impl_view.rs
parent20f7419c3d6d70ba8cfd996490020a5e1f2ad06d (diff)
Override Ctrl-C by disabling callback in Cursive
Thanks to @gyscos for the explanation in #22! Also removed extraneous code that's no longer needed.
Diffstat (limited to 'src/app/impl_view.rs')
-rw-r--r--src/app/impl_view.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/app/impl_view.rs b/src/app/impl_view.rs
index b735003..1261208 100644
--- a/src/app/impl_view.rs
+++ b/src/app/impl_view.rs
@@ -85,6 +85,7 @@ impl View for App {
85 if self.habits.is_empty() { 85 if self.habits.is_empty() {
86 return EventResult::Ignored; 86 return EventResult::Ignored;
87 } 87 }
88 let m = self.message.clone();
88 match e { 89 match e {
89 Event::Key(Key::Right) | Event::Key(Key::Tab) | Event::Char('l') => { 90 Event::Key(Key::Right) | Event::Key(Key::Tab) | Event::Char('l') => {
90 self.set_focus(Absolute::Right); 91 self.set_focus(Absolute::Right);
@@ -166,7 +167,7 @@ impl View for App {
166 return EventResult::Consumed(None); 167 return EventResult::Consumed(None);
167 } 168 }
168 Event::CtrlChar('c') => { 169 Event::CtrlChar('c') => {
169 self.message.write().unwrap().set_message("Use the :q command to quit"); 170 m.write().unwrap().set_message("Use the :q command to quit");
170 return EventResult::Consumed(None); 171 return EventResult::Consumed(None);
171 } 172 }
172 173