From 4044c70eb2d23402629d58d0e8904815abd68dc7 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sun, 23 Jan 2022 15:06:28 +0100 Subject: [PATCH] Fix picker won't scroll down when it hits the bottom #1544 (#1567) --- helix-term/src/ui/picker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 Component for Picker { 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