mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Fix the last line calculation inside ensure_cursor_in_view
This commit is contained in:
parent
c64240b6ef
commit
b5b650cfe7
@ -81,7 +81,8 @@ pub fn ensure_cursor_in_view(&mut self, doc: &Document) {
|
||||
let pos = coords_at_pos(doc.text().slice(..), cursor);
|
||||
let line = pos.row;
|
||||
let col = pos.col;
|
||||
let last_line = self.last_line(doc);
|
||||
let height = self.area.height.saturating_sub(1); // - 1 for statusline
|
||||
let last_line = self.first_line + height as usize;
|
||||
|
||||
let scrolloff = PADDING.min(self.area.height as usize / 2); // TODO: user pref
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user