Skip to content

Commit

Permalink
Fix picker won't scroll down when it hits the bottom #1544
Browse files Browse the repository at this point in the history
  • Loading branch information
hahanein committed Jan 19, 2022
1 parent 440d4ae commit 0ed794e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helix-term/src/ui/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ impl<T: 'static> Component for Picker<T> {
let selected = cx.editor.theme.get("ui.text.focus");

let rows = inner.height;
let offset = self.cursor / std::cmp::max(1, (rows as usize) * (rows as usize));
let offset = self.cursor - (self.cursor % rows as usize);

let files = self.matches.iter().skip(offset).map(|(index, _score)| {
(index, self.options.get(*index).unwrap()) // get_unchecked
Expand Down

0 comments on commit 0ed794e

Please sign in to comment.