From 5c910bc6cf193725575ef6146dcc8620e7a4a800 Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 22 Jul 2020 22:08:50 +0530 Subject: remove debug key binds, add :write command --- src/app/impl_self.rs | 2 +- src/app/impl_view.rs | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'src/app') diff --git a/src/app/impl_self.rs b/src/app/impl_self.rs index 7eae853..cf0e97f 100644 --- a/src/app/impl_self.rs +++ b/src/app/impl_self.rs @@ -257,7 +257,7 @@ impl App { self.message.set_message("help |commands|keys") } } - Command::Quit => self.save_state(), + Command::Quit | Command::Write => self.save_state(), Command::MonthNext => self.sift_forward(), Command::MonthPrev => self.sift_backward(), Command::Blank => {} diff --git a/src/app/impl_view.rs b/src/app/impl_view.rs index b8c4589..0dfd20b 100644 --- a/src/app/impl_view.rs +++ b/src/app/impl_view.rs @@ -102,17 +102,6 @@ impl View for App { self.set_focus(Absolute::Down); return EventResult::Consumed(None); } - Event::Char('w') => { - // helper bind to test write to file - let j = serde_json::to_string_pretty(&self.habits).unwrap(); - let mut file = File::create("foo.txt").unwrap(); - file.write_all(j.as_bytes()).unwrap(); - return EventResult::Consumed(None); - } - Event::Char('q') => { - self.save_state(); - return EventResult::with_cb(|s| s.quit()); - } Event::Char('v') => { if self.habits.is_empty() { return EventResult::Consumed(None); -- cgit v1.2.3