aboutsummaryrefslogtreecommitdiff
path: root/src/term/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r--src/term/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 21c97671..04d110af 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -1209,9 +1209,10 @@ impl Term {
/// Text moves down; clear at bottom
/// Expects origin to be in scroll range.
#[inline]
- fn scroll_down_relative(&mut self, origin: Line, lines: Line) {
+ fn scroll_down_relative(&mut self, origin: Line, mut lines: Line) {
trace!("scroll_down_relative: origin={}, lines={}", origin, lines);
- let lines = min(lines, self.scroll_region.end - self.scroll_region.start);
+ lines = min(lines, self.scroll_region.end - self.scroll_region.start);
+ lines = min(lines, self.scroll_region.end - origin);
// Scroll between origin and bottom
self.grid.scroll_down(&(origin..self.scroll_region.end), lines, &self.cursor.template);