From 5153f7908076ea505eb30a79af8be85eeff172f5 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Mon, 25 May 2020 21:14:25 +0200 Subject: [PATCH] fix selection bug --- src/components/commitlist.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/commitlist.rs b/src/components/commitlist.rs index 68e7d01b..3119d3c3 100644 --- a/src/components/commitlist.rs +++ b/src/components/commitlist.rs @@ -89,7 +89,9 @@ impl CommitList { /// pub fn selected_entry(&self) -> Option<&LogEntry> { - self.items.iter().nth(self.selection) + self.items.iter().nth( + self.selection.saturating_sub(self.items.index_offset()), + ) } fn move_selection(&mut self, scroll: ScrollType) -> Result {