aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorNathan Vegdahl2021-07-21 01:15:34 +0000
committerNathan Vegdahl2021-07-21 01:15:34 +0000
commitc848ed7abc7605c1bb1c6c98dfac23cadcb9e439 (patch)
treee9b9f40a74180de5ab1f3d21dfc5a9ebe3b310d8 /helix-view/src
parentd5534a6d10dacf6fc48e4891781038be278ca744 (diff)
Fixes for misc bugs with view movement.
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/view.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs
index 67585ed3..66214691 100644
--- a/helix-view/src/view.rs
+++ b/helix-view/src/view.rs
@@ -97,9 +97,9 @@ impl View {
const OFFSET: usize = 7; // 1 diagnostic + 5 linenr + 1 gutter
let last_col = self.first_col + (self.area.width as usize - OFFSET);
- if line > last_line.saturating_sub(scrolloff) {
+ if line > last_line.saturating_sub(scrolloff + 1) {
// scroll down
- self.first_line += line - (last_line.saturating_sub(scrolloff));
+ self.first_line += line - (last_line.saturating_sub(scrolloff + 1));
} else if line < self.first_line + scrolloff {
// scroll up
self.first_line = line.saturating_sub(scrolloff);