From f8edf059d441fca86017e2ec38fc950c61dc7d61 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sun, 17 Nov 2013 17:25:09 +0100 Subject: [PATCH] fix scrolling bug. Closes T106 Was fixed with help from great bug report by thomasg. scroll_rev was ok --- src/bin/termptyesc.c | 2 ++ src/bin/termptyops.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index c96aaabc..8015b51d 100644 --- a/src/bin/termptyesc.c +++ b/src/bin/termptyesc.c @@ -944,6 +944,8 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce) if (arg2 > ty->h) arg2 = ty->h; ty->state.scroll_y1 = arg - 1; ty->state.scroll_y2 = arg2; + if ((arg == 1) && (arg2 == ty->h)) + ty->state.scroll_y2 = 0; } } } diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c index ee442131..428d7d87 100644 --- a/src/bin/termptyops.c +++ b/src/bin/termptyops.c @@ -90,11 +90,11 @@ _termpty_text_scroll(Termpty *ty, Eina_Bool clear) } else { - cells = &(ty->screen[end_y * ty->w]); + cells = &(TERMPTY_SCREEN(ty, 0, end_y)); for (y = start_y; y < end_y; y++) { - cells = &(ty->screen[(y + 1) * ty->w]); - cells2 = &(ty->screen[y * ty->w]); + cells = &(TERMPTY_SCREEN(ty, 0, (y + 1))); + cells2 = &(TERMPTY_SCREEN(ty, 0, y)); termpty_cell_copy(ty, cells, cells2, ty->w); } if (clear)