diff options
author | Blaž Hrastnik | 2021-03-04 07:13:26 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-04 07:15:34 +0000 |
commit | a5c4314940e2ef875026f52ffb6f285725d3fb02 (patch) | |
tree | c5bfadb6dfe6d825afae25b8892f8a3001a4094f /helix-view/src | |
parent | 565fb94afe817eb698f219d1fed76fe5ff7e27cd (diff) |
commands: Improve scroll functions.
Followed kakoune's implementation, it's no longer janky and can scroll
all the way in either direction.
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/view.rs | 11 |
1 files changed, 0 insertions, 11 deletions
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); |