billiob pushed a commit to branch master.

commit ce65369d579dd649162d838f08ae3198a841d33d
Author: Boris Faure <[email protected]>
Date:   Sun Apr 7 23:16:32 2013 +0200

    reflow: fix displaying history on vertical expansion
---
 src/bin/termpty.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index ae810f8..c2f92d8 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -727,7 +727,7 @@ _termpty_vertically_expand(Termpty *ty, int old_w, int 
old_h,
              Termcell *c1, *c2;
 
              c1 = &(OLD_SCREEN(0, y));
-             c2 = &(TERMPTY_SCREEN(ty, 0, y + from_history));
+             c2 = &(TERMPTY_SCREEN(ty, 0, y));
              termpty_cell_copy(ty, c1, c2, old_w);
           }
      }
@@ -747,7 +747,7 @@ _termpty_vertically_expand(Termpty *ty, int old_w, int 
old_h,
         ts = ty->back[ty->backpos];
 
         src = ts->cell;
-        dst = &(TERMPTY_SCREEN(ty, 0, y));
+        dst = &(TERMPTY_SCREEN(ty, 0, ty->h - from_history + y));
         termpty_cell_copy(ty, src, dst, ts->w);
 
         free(ts);
@@ -755,6 +755,8 @@ _termpty_vertically_expand(Termpty *ty, int old_w, int 
old_h,
         ty->backscroll_num--;
      }
 
+   ty->circular_offset = (ty->circular_offset + ty->h - from_history) % ty->h;
+
    ty->state.cy += from_history;
 }
 

-- 

------------------------------------------------------------------------------
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

Reply via email to