aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin2022-01-23 14:06:28 +0000
committerGitHub2022-01-23 14:06:28 +0000
commit4044c70eb2d23402629d58d0e8904815abd68dc7 (patch)
tree4f86d6ae412621e3dcf46022711b8aab1ac8a2fe
parent759b850859727da9ef3e3c06cdab0300d242f1fe (diff)
Fix picker won't scroll down when it hits the bottom #1544 (#1567)
-rw-r--r--helix-term/src/ui/picker.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index e9692809..945e14bb 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -500,7 +500,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 % std::cmp::max(1, rows as usize));
let files = self.matches.iter().skip(offset).map(|(index, _score)| {
(index, self.options.get(*index).unwrap()) // get_unchecked