aboutsummaryrefslogtreecommitdiff
path: root/src/grid.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/grid.rs')
-rw-r--r--src/grid.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/grid.rs b/src/grid.rs
index c57787bf..ed7efdb4 100644
--- a/src/grid.rs
+++ b/src/grid.rs
@@ -151,14 +151,14 @@ impl<T> Grid<T> {
}
#[inline]
- pub fn scroll_down(&mut self, region: Range<index::Line>, positions: index::Line) {
+ pub fn scroll_down(&mut self, region: &Range<index::Line>, positions: index::Line) {
for line in IndexRange((region.start + positions)..region.end).rev() {
self.swap_lines(line, line - positions);
}
}
#[inline]
- pub fn scroll_up(&mut self, region: Range<index::Line>, positions: index::Line) {
+ pub fn scroll_up(&mut self, region: &Range<index::Line>, positions: index::Line) {
for line in IndexRange(region.start..(region.end - positions)) {
self.swap_lines(line, line + positions);
}
@@ -618,7 +618,7 @@ mod tests {
info!("grid: {:?}", grid);
- grid.scroll_up(Line(0)..Line(10), Line(2));
+ grid.scroll_up(&(Line(0)..Line(10)), Line(2));
info!("grid: {:?}", grid);
@@ -652,7 +652,7 @@ mod tests {
info!("grid: {:?}", grid);
- grid.scroll_down(Line(0)..Line(10), Line(2));
+ grid.scroll_down(&(Line(0)..Line(10)), Line(2));
info!("grid: {:?}", grid);