@@ -246,13 +246,14 @@ impl<T: 'static> Component for Picker<T> {
246 let selected = Style::default().fg(Color::Rgb(255, 255, 255));
246 let selected = Style::default().fg(Color::Rgb(255, 255, 255));
248 let rows = inner.height - 2; // -1 for search bar
248 let rows = inner.height - 2; // -1 for search bar
249+ let offset = self.cursor / (rows as usize) * (rows as usize);
250− let files = self.matches.iter().map(|(index, _score)| {
251+ let files = self.matches.iter().skip(offset).map(|(index, _score)| {
251 (index, self.options.get(*index).unwrap()) // get_unchecked
252 (index, self.options.get(*index).unwrap()) // get_unchecked
254 for (i, (_index, option)) in files.take(rows as usize).enumerate() {
255 for (i, (_index, option)) in files.take(rows as usize).enumerate() {
255− if i == self.cursor {
256+ if i == (self.cursor - offset) {
256 surface.set_string(inner.x + 1, inner.y + 2 + i as u16, ">", selected);
257 surface.set_string(inner.x + 1, inner.y + 2 + i as u16, ">", selected);
@@ -261,7 +262,11 @@ impl<T: 'static> Component for Picker<T> {
261 inner.y + 2 + i as u16,
262 inner.y + 2 + i as u16,
262 (self.format_fn)(option),
263 (self.format_fn)(option),
263 inner.width as usize - 1,
264 inner.width as usize - 1,
264− if i == self.cursor { selected } else { style },
265+ if i == (self.cursor - offset) {