summaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authornicm <nicm>2018-07-04 09:44:07 +0000
committernicm <nicm>2018-07-04 09:44:07 +0000
commit2fae6a57618e1cef47b65e73504d7d5570ca6a8e (patch)
tree4d78d6245bdeddf44fbf21fa8dc50ab28c58a12f /screen.c
parent42935bde71df2bc4ae765a27571f5dadff542e70 (diff)
Add accessors for grid linedata member, for some future work. From Dan
Aloni.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/screen.c b/screen.c
index 20616915..d2cf0724 100644
--- a/screen.c
+++ b/screen.c
@@ -281,9 +281,8 @@ screen_resize_y(struct screen *s, u_int sy)
s->cy -= needed;
}
- /* Resize line arrays. */
- gd->linedata = xreallocarray(gd->linedata, gd->hsize + sy,
- sizeof *gd->linedata);
+ /* Resize line array. */
+ grid_adjust_lines(gd, gd->hsize + sy);
/* Size increasing. */
if (sy > oldy) {
@@ -306,7 +305,7 @@ screen_resize_y(struct screen *s, u_int sy)
/* Then fill the rest in with blanks. */
for (i = gd->hsize + sy - needed; i < gd->hsize + sy; i++)
- memset(&gd->linedata[i], 0, sizeof gd->linedata[i]);
+ memset(grid_get_line(gd, i), 0, sizeof(struct grid_line));
}
/* Set the new size, and reset the scroll region. */