From fcc94f8705ee0b604af25958668c30f79c3dec1d Mon Sep 17 00:00:00 2001 From: iximeow Date: Mon, 13 Nov 2017 01:49:46 -0800 Subject: fix pageup/pagedown seeking through twitter events --- src/display/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/display') diff --git a/src/display/mod.rs b/src/display/mod.rs index 1c26678..8760f4a 100644 --- a/src/display/mod.rs +++ b/src/display/mod.rs @@ -108,8 +108,9 @@ pub fn paint(tweeter: &mut ::tw::TwitterCache) -> Result<(), std::io::Error> { } // draw status lines // draw tweets - let last_twevent = tweeter.display_info.infos.len().saturating_sub(height as usize - 4).saturating_sub(tweeter.display_info.infos_seek as usize); - let last_few_twevent: Vec = tweeter.display_info.infos[last_twevent..].iter().map(|x| x.clone()).rev().collect::>(); + let last_tail_twevent = tweeter.display_info.infos.len().saturating_sub(tweeter.display_info.infos_seek as usize); + let first_tail_twevent = last_tail_twevent.saturating_sub(height as usize - 4); + let last_few_twevent: Vec = tweeter.display_info.infos[first_tail_twevent..last_tail_twevent].iter().map(|x| x.clone()).rev().collect::>(); let mut h = tweeter.display_info.ui_height(); -- cgit v1.1