billiob pushed a commit to branch master.

commit 0c47c4ba4d6d5a4bdda107957c908525129a349f
Author: Boris Faure <[email protected]>
Date:   Fri Apr 12 22:12:31 2013 +0200

    reflow: fix horizontal shrinking
---
 src/bin/termpty.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index cd5eb17..b805bfd 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -868,7 +868,8 @@ _termpty_horizontally_shrink(Termpty *ty, int old_w, int 
old_h,
             *old_ts = NULL;
    Termcell *old_cells = NULL;
    Eina_Bool rewrapping = EINA_FALSE,
-             done = EINA_FALSE;
+             done = EINA_FALSE,
+             cy_pushed_back = EINA_FALSE;
 
    if (!ty->backmax || !ty->back)
      goto shrink_screen;
@@ -1085,7 +1086,7 @@ shrink_screen:
                   else
                     {
                        if (old_y < old_h - 1)
-                          need_new_line = EINA_TRUE;
+                         need_new_line = EINA_TRUE;
                     }
                }
              if (need_new_line)
@@ -1101,7 +1102,12 @@ shrink_screen:
                        cells = &TERMPTY_SCREEN(ty, 0, y);
                        len = termpty_line_length(cells, ty->w);
                        termpty_text_save_top(ty, cells, len);
-                       ty->state.cy--;
+                       memset(cells, 0, sizeof(Termcell) * len);
+                       if (ty->state.cy == old_y || cy_pushed_back)
+                         {
+                            cy_pushed_back = EINA_TRUE;
+                            ty->state.cy--;
+                         }
                     }
                   else
                     y++;

-- 

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