diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 090ba242..84b8dd72 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -124,6 +124,7 @@ impl Component for FilePicker { }) { // align to middle let first_line = line + .map(|(s, e)| (s.min(doc.text().len_lines()), e.min(doc.text().len_lines()))) .map(|(start, _)| start) .unwrap_or(0) .saturating_sub(inner.height as usize / 2);