X-Git-Url: http://git.madism.org/?p=apps%2Fmadtty.git;a=blobdiff_plain;f=madtty%2Fmadtty.c;h=251780fa2f3222c1931657dcbd48bf06d7dc1dac;hp=95ea5e2564f7819f0498db82edce8c0c79db0a46;hb=eccf6c1911e647ad25dc932fbaeb0901f60ec023;hpb=05d69048eb7e641221e29df9405741c4bc7dfd59 diff --git a/madtty/madtty.c b/madtty/madtty.c index 95ea5e2..251780f 100644 --- a/madtty/madtty.c +++ b/madtty/madtty.c @@ -856,6 +856,8 @@ void madtty_resize(madtty_t *t, int rows, int cols) lines[row].attr = realloc(lines[row].attr, sizeof(uint16_t) * cols); if (t->cols < cols) t_row_set(lines + row, t->cols, cols - t->cols, 0); + else + lines[row].dirty = true; } t->cols = cols; } @@ -863,14 +865,13 @@ void madtty_resize(madtty_t *t, int rows, int cols) while (t->rows < rows) { lines[t->rows].text = (wchar_t *)calloc(sizeof(wchar_t), cols); lines[t->rows].attr = (uint16_t *)calloc(sizeof(uint16_t), cols); + t_row_set(lines + t->rows, 0, t->cols, 0); t->rows++; } t->curs_row += lines - t->lines; - t->scroll_top += lines - t->lines; - t->scroll_bot += lines - t->lines; - if (t->scroll_bot > lines + t->rows) - t->scroll_bot = lines + t->rows; + t->scroll_top = lines; + t->scroll_bot = lines + rows; t->lines = lines; clamp_cursor_to_bounds(t); ioctl(t->pty, TIOCSWINSZ, &ws);