wip fix scroll_down
This commit is contained in:
parent
9b9b138bac
commit
f67b17ca7b
|
@ -236,8 +236,11 @@ impl<T: Copy + Clone> Grid<T> {
|
||||||
self.raw.rotate_up(*positions);
|
self.raw.rotate_up(*positions);
|
||||||
|
|
||||||
// Now, restore any scroll region lines
|
// Now, restore any scroll region lines
|
||||||
for i in IndexRange(region.end .. self.num_lines()) {
|
let lines = self.lines;
|
||||||
|
for i in IndexRange(region.end .. lines) {
|
||||||
// First do the swap
|
// First do the swap
|
||||||
|
// TODO there is a bug here causing a panic.
|
||||||
|
// TODO math
|
||||||
self.raw.swap_lines(i, i + positions);
|
self.raw.swap_lines(i, i + positions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,7 @@ impl<T> Storage<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn swap_lines(&mut self, a: Line, b: Line) {
|
pub fn swap_lines(&mut self, a: Line, b: Line) {
|
||||||
|
println!("visible: {}, a: {}, b: {}", self.visible_lines, a, b);
|
||||||
let a = self.visible_lines - a;
|
let a = self.visible_lines - a;
|
||||||
let b = self.visible_lines - b;
|
let b = self.visible_lines - b;
|
||||||
self.swap(*a, *b);
|
self.swap(*a, *b);
|
||||||
|
|
Loading…
Reference in New Issue