From 879b115d651b26d3935f5c95d06f426019dedcd3 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 21 Feb 2021 10:12:10 +0530 Subject: remove all instances of view_month_offset --- src/app/impl_self.rs | 1 - src/app/impl_view.rs | 5 ++--- src/app/mod.rs | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/app') diff --git a/src/app/impl_self.rs b/src/app/impl_self.rs index fec7219..d5f93ff 100644 --- a/src/app/impl_self.rs +++ b/src/app/impl_self.rs @@ -27,7 +27,6 @@ impl App { focus: 0, _file_watcher: watcher, file_event_recv: rx, - view_month_offset: 0, cursor: Cursor::new(), message: Message::startup(), }; diff --git a/src/app/impl_view.rs b/src/app/impl_view.rs index db05432..98f540c 100644 --- a/src/app/impl_view.rs +++ b/src/app/impl_view.rs @@ -134,6 +134,7 @@ impl View for App { for habit in self.habits.iter_mut() { habit.inner_data_mut_ref().set_view_mode(ViewMode::Day); } + self.reset_cursor(); return EventResult::Consumed(None); } @@ -159,14 +160,12 @@ impl View for App { } /* Every keybind that is not caught by App trickles - * down to the focused habit. We sift back to today - * before performing any action, "refocusing" the cursor + * down to the focused habit. * */ _ => { if self.habits.is_empty() { return EventResult::Ignored; } - self.reset_cursor(); self.habits[self.focus].on_event(e) } } diff --git a/src/app/mod.rs b/src/app/mod.rs index 9432f0d..726a656 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -21,7 +21,6 @@ pub struct App { _file_watcher: RecommendedWatcher, file_event_recv: Receiver, focus: usize, - view_month_offset: u32, cursor: Cursor, message: Message, } -- cgit v1.2.3