From ee9be05579d87ca99f153d20995af3273385b564 Mon Sep 17 00:00:00 2001 From: nc Date: Wed, 5 Aug 2020 22:08:51 -0400 Subject: 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. --- src/app/impl_view.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/app/impl_view.rs') 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 { if self.habits.is_empty() { return EventResult::Ignored; } + let m = self.message.clone(); match e { Event::Key(Key::Right) | Event::Key(Key::Tab) | Event::Char('l') => { self.set_focus(Absolute::Right); @@ -166,7 +167,7 @@ impl View for App { return EventResult::Consumed(None); } Event::CtrlChar('c') => { - self.message.write().unwrap().set_message("Use the :q command to quit"); + m.write().unwrap().set_message("Use the :q command to quit"); return EventResult::Consumed(None); } -- cgit v1.2.3