From a5c4314940e2ef875026f52ffb6f285725d3fb02 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Thu, 4 Mar 2021 16:13:26 +0900 Subject: commands: Improve scroll functions. Followed kakoune's implementation, it's no longer janky and can scroll all the way in either direction. --- helix-view/src/view.rs | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'helix-view') diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs index 1d806da9..15f0171f 100644 --- a/helix-view/src/view.rs +++ b/helix-view/src/view.rs @@ -35,17 +35,6 @@ impl View { Ok(view) } - pub fn check_cursor_in_view(&self) -> bool { - let cursor = self.doc.selection().cursor(); - let line = self.doc.text().char_to_line(cursor); - let document_end = self.first_line + self.area.height.saturating_sub(1) as usize; - - if (line > document_end.saturating_sub(PADDING)) || (line < self.first_line + PADDING) { - return false; - } - true - } - pub fn ensure_cursor_in_view(&mut self) { let cursor = self.doc.state.selection().cursor(); let line = self.doc.text().char_to_line(cursor); -- cgit v1.2.3-70-g09d2