Fix the last line calculation inside ensure_cursor_in_view
commitb5b650cfe7df36e83b96c6663f2dc041f5d2b748
authorBlaž Hrastnik <blaz@mxxn.io>
dateWed 14 Apr 2021, 17:15 (6 years ago)
parentc64240b
helix-view/src/view.rs+2−1
@@ -81,7 +81,8 @@ impl View {
8181 let pos = coords_at_pos(doc.text().slice(..), cursor);
8282 let line = pos.row;
8383 let col = pos.col;
84− let last_line = self.last_line(doc);
84+ let height = self.area.height.saturating_sub(1); // - 1 for statusline
85+ let last_line = self.first_line + height as usize;
8586
8687 let scrolloff = PADDING.min(self.area.height as usize / 2); // TODO: user pref
8788