From 9017fa0c3974a15b0216e3d2643d25ef9fc21624 Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 2 Jul 2020 22:29:20 +0530 Subject: fix focus-on-delete bug --- src/app.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src') diff --git a/src/app.rs b/src/app.rs index 276b7ff..4ea342f 100644 --- a/src/app.rs +++ b/src/app.rs @@ -254,18 +254,9 @@ impl View for App { self.set_focus(Absolute::Down); return EventResult::Consumed(None); } - Event::Char('a') => { - let mut gymming = Count::new("gym", 5); - gymming.insert_entry(NaiveDate::from_ymd(2020, 4, 11), 7); - gymming.insert_entry(NaiveDate::from_ymd(2020, 4, 12), 8); - gymming.insert_entry(NaiveDate::from_ymd(2020, 4, 13), 9); - gymming.insert_entry(NaiveDate::from_ymd(2020, 4, 14), 10); - gymming.insert_entry(NaiveDate::from_ymd(2020, 4, 15), 11); - self.add_habit(Box::new(gymming)); - return EventResult::Consumed(None); - } Event::Char('d') => { self.habits.remove(self.focus); + self.focus = 0; return EventResult::Consumed(None); } Event::Char('w') => { -- cgit v1.2.3