From ce65369d579dd649162d838f08ae3198a841d33d Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sun, 7 Apr 2013 23:16:32 +0200 Subject: [PATCH] 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 ae810f8c..c2f92d82 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; }