From 66b2f0793f236dccd3269ae1c3cbfe2293f7fb3d Mon Sep 17 00:00:00 2001 From: nc Date: Mon, 20 Jul 2020 18:30:32 -0400 Subject: Add RwLock around messages. Catch SIGINT and print that :q is the way to quit. Note that this doesn't actually capture Ctrl-C. I'm not sure how it works but termion somehow swollows Ctrl-C so and circumvents the signal handler... --- src/app/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/app/mod.rs') diff --git a/src/app/mod.rs b/src/app/mod.rs index 2aecb33..bce6e79 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -5,6 +5,8 @@ use notify::{DebouncedEvent, RecommendedWatcher}; use crate::habit::HabitWrapper; +use std::sync::{RwLock, Arc}; + mod impl_self; mod impl_view; mod message; @@ -20,7 +22,7 @@ pub struct App { file_event_recv: Receiver, focus: usize, view_month_offset: u32, - message: Message, + pub message: Arc>, } impl Default for App { -- cgit v1.2.3