billiob pushed a commit to branch master. http://git.enlightenment.org/apps/terminology.git/commit/?id=59a7627e86efa146f94ced293b73c8aa361ea8d0
commit 59a7627e86efa146f94ced293b73c8aa361ea8d0 Author: Aleksandar Popadić <aleksandar.popa...@siol.net> Date: Tue Dec 10 21:21:32 2013 +0100 Fix reflow on resize when in alternate buffer. Closes T637 Summary: After commit 05d091483a29e7937914e9fd4e94d0c6d9043aad screen swap form alternate buffer to primary buffer is not the same as the reversed. Take this into account when resizing. Test Plan: Build history, man echo, resize, quit manual. Reviewers: billiob Differential Revision: https://phab.enlightenment.org/D370 --- src/bin/termpty.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/bin/termpty.c b/src/bin/termpty.c index 4b8a240..8d30272 100644 --- a/src/bin/termpty.c +++ b/src/bin/termpty.c @@ -741,7 +741,7 @@ termpty_resize(Termpty *ty, int new_w, int new_h) Termcell *new_screen; Termsave **new_back; int y_start, y_end, new_y_start, new_y_end; - int i; + int i, altbuf = 0; if ((ty->w == new_w) && (ty->h == new_h)) return; @@ -750,7 +750,7 @@ termpty_resize(Termpty *ty, int new_w, int new_h) if (ty->altbuf) { termpty_screen_swap(ty); - ty->altbuf = 1; + altbuf = 1; } new_screen = calloc(1, sizeof(Termcell) * new_w * new_h); @@ -809,11 +809,7 @@ termpty_resize(Termpty *ty, int new_w, int new_h) ty->screen = new_screen; ty->back = new_back; - if (ty->altbuf) - { - termpty_screen_swap(ty); - ty->altbuf = 1; - } + if (altbuf) termpty_screen_swap(ty); _limit_coord(ty, &(ty->state)); _limit_coord(ty, &(ty->swap)); @@ -1017,6 +1013,7 @@ termpty_screen_swap(Termpty *ty) { Termcell *tmp_screen; int tmp_circular_offset; + int tmp_appcursor = ty->state.appcursor; tmp_screen = ty->screen; ty->screen = ty->screen2; @@ -1031,6 +1028,8 @@ termpty_screen_swap(Termpty *ty) ty->circular_offset = ty->circular_offset2; ty->circular_offset2 = tmp_circular_offset; + ty->state.appcursor = tmp_appcursor; + ty->altbuf = !ty->altbuf; if (ty->cb.cancel_sel.func) --