on master help sign in
Fix picker won't scroll down when it hits the bottom #1544 (#1567)
commit4044c70eb2d23402629d58d0e8904815abd68dc7 authorBenjamin <hahanein@users.noreply.github.com> dateSun 23 Jan 2022, 15:06 (5 years ago) parent759b850
1 file changed+1−1
helix-term/src/ui/picker.rs+1−1
helix-term/src/ui/picker.rs+1−1
@@ -500,7 +500,7 @@ impl<T: 'static> Component for Picker<T> {
500500 let selected = cx.editor.theme.get("ui.text.focus");
501501
502502 let rows = inner.height;
503− let offset = self.cursor / std::cmp::max(1, (rows as usize) * (rows as usize));
503+ let offset = self.cursor - (self.cursor % std::cmp::max(1, rows as usize));
504504
505505 let files = self.matches.iter().skip(offset).map(|(index, _score)| {
506506 (index, self.options.get(*index).unwrap()) // get_unchecked