on master help sign in
Fix the last line calculation inside ensure_cursor_in_view
b5b650cBlaž Hrastnik
helix-view/src/view.rs+2−1
@@ -81,7 +81,8 @@ impl View {
81 let pos = coords_at_pos(doc.text().slice(..), cursor);
81 let pos = coords_at_pos(doc.text().slice(..), cursor);
82 let line = pos.row;
82 let line = pos.row;
83 let col = pos.col;
83 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;
85
86
86 let scrolloff = PADDING.min(self.area.height as usize / 2); // TODO: user pref
87 let scrolloff = PADDING.min(self.area.height as usize / 2); // TODO: user pref
87
88