From 7208c86f23ac6d75aff62268cff73089c068cf74 Mon Sep 17 00:00:00 2001 From: Jan Hrastnik Date: Sat, 10 Oct 2020 19:54:16 +0200 Subject: separated statusline and prompt --- helix-view/src/view.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'helix-view') diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs index 44f7576f..2b68dbc3 100644 --- a/helix-view/src/view.rs +++ b/helix-view/src/view.rs @@ -39,7 +39,7 @@ impl View { pub fn ensure_cursor_in_view(&mut self) { let cursor = self.state.selection().cursor(); let line = self.state.doc().char_to_line(cursor); - let document_end = self.first_line + (self.size.1 as usize).saturating_sub(1); + let document_end = self.first_line + (self.size.1 as usize).saturating_sub(2); // TODO: side scroll @@ -55,7 +55,7 @@ impl View { /// Calculates the last visible line on screen #[inline] pub fn last_line(&self) -> usize { - let viewport = Rect::new(6, 0, self.size.0, self.size.1 - 1); // - 1 for statusline + let viewport = Rect::new(6, 0, self.size.0, self.size.1 - 2); // - 2 for statusline and prompt std::cmp::min( self.first_line + (viewport.height as usize), self.state.doc().len_lines() - 1, -- cgit v1.2.3-70-g09d2