summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-10-22 15:07:59 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2013-10-22 15:07:59 +0200
commit57ca3c86f759f48b2507b897c5c226eba31519e6 (patch)
tree73ced4a3601e41deb80f9515473b93d3d177795b
parentd8fff006f8a4fa2a328199fbbad3e11596aa1aaa (diff)
screen: correctly clear expansion area
We incorrectly clear the alternate-screen and width-extensions. Fix this. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--src/tsm_screen.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/tsm_screen.c b/src/tsm_screen.c
index 871fad7..a4d86bf 100644
--- a/src/tsm_screen.c
+++ b/src/tsm_screen.c
@@ -644,24 +644,20 @@ int tsm_screen_resize(struct tsm_screen *con, unsigned int x,
}
}
+ /* clear expansion area */
for (j = 0; j < con->line_num; ++j) {
- if (j >= con->size_y)
- i = 0;
- else
+ i = 0;
+ if (j < con->size_y)
i = con->size_x;
- if (x < con->main_lines[j]->size)
- width = x;
- else
- width = con->main_lines[j]->size;
- for (; i < width; ++i)
+ for ( ; i < x; ++i)
cell_init(con, &con->main_lines[j]->cells[i]);
- if (x < con->alt_lines[j]->size)
- width = x;
- else
- width = con->alt_lines[j]->size;
- for (; i < width; ++i)
+ i = 0;
+ if (j < con->size_y)
+ i = con->size_x;
+
+ for ( ; i < x; ++i)
cell_init(con, &con->alt_lines[j]->cells[i]);
}