mirror of
https://github.com/tmux/tmux.git
synced 2026-01-11 16:30:22 +00:00
Clear trimmed lines after moving, from Antony Raj in GitHub issue 4790.
This commit is contained in:
6
grid.c
6
grid.c
@@ -361,9 +361,13 @@ grid_compare(struct grid *ga, struct grid *gb)
|
|||||||
static void
|
static void
|
||||||
grid_trim_history(struct grid *gd, u_int ny)
|
grid_trim_history(struct grid *gd, u_int ny)
|
||||||
{
|
{
|
||||||
|
u_int remaining;
|
||||||
|
|
||||||
grid_free_lines(gd, 0, ny);
|
grid_free_lines(gd, 0, ny);
|
||||||
|
remaining = gd->hsize + gd->sy - ny;
|
||||||
memmove(&gd->linedata[0], &gd->linedata[ny],
|
memmove(&gd->linedata[0], &gd->linedata[ny],
|
||||||
(gd->hsize + gd->sy - ny) * (sizeof *gd->linedata));
|
remaining * (sizeof *gd->linedata));
|
||||||
|
memset(&gd->linedata[remaining], 0, ny * (sizeof *gd->linedata));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user