diff --git a/src/components/commitlist.rs b/src/components/commitlist.rs index 96f05f38..3ba09e1f 100644 --- a/src/components/commitlist.rs +++ b/src/components/commitlist.rs @@ -636,11 +636,7 @@ impl CommitList { if !hit_upper_bound { self.selection = old_selection + offset; - if self - .selected_entry() - .map(|entry| entry.highlighted) - .unwrap_or_default() - { + if self.selection_highlighted() { break; } } @@ -648,11 +644,7 @@ impl CommitList { if !hit_lower_bound { self.selection = old_selection - offset; - if self - .selected_entry() - .map(|entry| entry.highlighted) - .unwrap_or_default() - { + if self.selection_highlighted() { break; } } @@ -666,6 +658,12 @@ impl CommitList { } } + fn selection_highlighted(&mut self) -> bool { + self.selected_entry() + .map(|entry| entry.highlighted) + .unwrap_or_default() + } + /// pub fn needs_data(&self, idx: usize, idx_max: usize) -> bool { self.items.needs_data(idx, idx_max)