diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-02-14 21:43:23 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-02-14 21:43:23 +0000 |
| commit | d11a71e0b221cc24404da37ea928708a03d65c47 (patch) | |
| tree | 90dcba756a8ab74d9de7f7f32e001740ae69bb79 | |
| parent | term: convert cell 'linefeed' attribute to a row 'linebreak' property (diff) | |
term: reset: use grid_row_alloc() with initialize=true
This will both zero out the cells, *and* re-initialize the row
properties correctly.
| -rw-r--r-- | terminal.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1090,8 +1090,8 @@ term_reset(struct terminal *term, bool hard) term->normal.offset = term->normal.view = 0; term->alt.offset = term->alt.view = 0; for (size_t i = 0; i < term->rows; i++) { - memset(grid_row_and_alloc(&term->normal, i)->cells, 0, term->cols * sizeof(struct cell)); - memset(grid_row_and_alloc(&term->alt, i)->cells, 0, term->cols * sizeof(struct cell)); + term->normal.rows[i] = grid_row_alloc(term->cols, true); + term->alt.rows[i] = grid_row_alloc(term->cols, true); } for (size_t i = term->rows; i < term->normal.num_rows; i++) { grid_row_free(term->normal.rows[i]); |
