wip fix scroll_down

This commit is contained in:
Joe Wilm committed 2018-03-07 09:47:21 -08:00
1 parent 8854124ff0
commit 96da93efd6
2 files changed
+5 -1

No files matched your search

+4 -1
View File
@@ -236,8 +236,11 @@ impl<T: Copy + Clone> Grid<T> {
self.raw.rotate_up(*positions);
// 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
// TODO there is a bug here causing a panic.
// TODO math
self.raw.swap_lines(i, i + positions);
}
+1
View File
@@ -69,6 +69,7 @@ impl<T> Storage<T> {
}
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 b = self.visible_lines - b;
self.swap(*a, *b);