on master help sign in
Fix picker won't scroll down when it hits the bottom #1544 (#1567)
4044c70Benjamin
helix-term/src/ui/picker.rs+1−1
@@ -500,7 +500,7 @@ impl<T: 'static> Component for Picker<T> {
500 let selected = cx.editor.theme.get("ui.text.focus");
500 let selected = cx.editor.theme.get("ui.text.focus");
501
501
502 let rows = inner.height;
502 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));
504
504
505 let files = self.matches.iter().skip(offset).map(|(index, _score)| {
505 let files = self.matches.iter().skip(offset).map(|(index, _score)| {
506 (index, self.options.get(*index).unwrap()) // get_unchecked
506 (index, self.options.get(*index).unwrap()) // get_unchecked