summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/window.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/window.cc b/src/window.cc
index 24a02cff..5396f662 100644
--- a/src/window.cc
+++ b/src/window.cc
@@ -133,7 +133,7 @@ static LineCount adapt_view_pos(LineCount line, LineCount offset,
if (line - offset < view_pos)
return std::max(0_line, line - offset);
else if (line + offset >= view_pos + view_size)
- return std::max(0_line, line + offset - view_size);
+ return std::max(0_line, line + offset - view_size + 1);
return view_pos;
}