billiob pushed a commit to branch master.
commit b605913b1d3c1092a6ff8382c162b0a0b9559b81
Author: Boris Faure <[email protected]>
Date: Wed Mar 20 22:50:16 2013 +0100
reflow: fix backscroll expansion when full
---
src/bin/termpty.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index be4a379..f36b7d3 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -512,7 +512,7 @@ _termpty_horizontally_expand(Termpty *ty, int old_w, int
old_h,
Termsave *ts;
if (ty->backscroll_num == ty->backmax - 1)
- ts = ty->back[(ty->backpos + i) % ty->backscroll_num];
+ ts = ty->back[(ty->backpos + i) % ty->backmax];
else
ts = ty->back[i];
if (!ts)
@@ -592,8 +592,16 @@ _termpty_horizontally_expand(Termpty *ty, int old_w, int
old_h,
}
}
- ty->backscroll_num = new_back_pos;
- ty->backpos = new_back_pos;
+ if (new_back_pos >= ty->backmax)
+ {
+ ty->backscroll_num = ty->backmax - 1;
+ ty->backpos = 0;
+ }
+ else
+ {
+ ty->backscroll_num = new_back_pos;
+ ty->backpos = new_back_pos;
+ }
free(ty->back);
ty->back = new_back;
--
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter