@@ -53,12 +53,12 @@ pub fn align_view(doc: &Document, view: &mut View, align: Align) {
5353 .cursor(doc.text().slice(..));
5454 let line = doc.text().char_to_line(pos);
5555
56− let height = view.inner_area().height as usize;
56+ let last_line_height = view.inner_area().height.saturating_sub(1) as usize;
5757
5858 let relative = match align {
59− Align::Center => height / 2,
59+ Align::Center => last_line_height / 2,
6060 Align::Top => 0,
61− Align::Bottom => height,
61+ Align::Bottom => last_line_height,
6262 };
6363
6464 view.offset.row = line.saturating_sub(relative);