aboutsummaryrefslogtreecommitdiff
path: root/src/app/mod.rs
diff options
context:
space:
mode:
authornc <[email protected]>2020-07-20 23:30:32 +0100
committernc <[email protected]>2020-07-20 23:30:32 +0100
commit66b2f0793f236dccd3269ae1c3cbfe2293f7fb3d (patch)
tree0e1a2604d9d395bda8d8eaae12353014b6adc836 /src/app/mod.rs
parent2a3be003015bac9c6a13549029b9fb4595e88384 (diff)
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...
Diffstat (limited to 'src/app/mod.rs')
-rw-r--r--src/app/mod.rs4
1 files changed, 3 insertions, 1 deletions
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};
5 5
6use crate::habit::HabitWrapper; 6use crate::habit::HabitWrapper;
7 7
8use std::sync::{RwLock, Arc};
9
8mod impl_self; 10mod impl_self;
9mod impl_view; 11mod impl_view;
10mod message; 12mod message;
@@ -20,7 +22,7 @@ pub struct App {
20 file_event_recv: Receiver<DebouncedEvent>, 22 file_event_recv: Receiver<DebouncedEvent>,
21 focus: usize, 23 focus: usize,
22 view_month_offset: u32, 24 view_month_offset: u32,
23 message: Message, 25 pub message: Arc<RwLock<Message>>,
24} 26}
25 27
26impl Default for App { 28impl Default for App {