mirror of
https://github.com/tmux/tmux.git
synced 2026-07-03 10:12:31 +00:00
More checks for macOS.
This commit is contained in:
35
grid.c
35
grid.c
@@ -74,11 +74,45 @@ grid_check_lines(struct grid *gd)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grid_check_is_clear(struct grid *gd)
|
||||
{
|
||||
struct grid_line *gl;
|
||||
u_int yy, ny;
|
||||
|
||||
assert(gd != NULL);
|
||||
|
||||
if (gd->sy == 0) {
|
||||
assert(gd->linedata == NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
assert(gd->linedata != NULL);
|
||||
|
||||
ny = gd->hsize + gd->sy;
|
||||
for (yy = 0; yy < ny; yy++) {
|
||||
gl = &gd->linedata[yy];
|
||||
|
||||
assert(gl->celldata == NULL);
|
||||
assert(gl->cellused == 0);
|
||||
assert(gl->cellsize == 0);
|
||||
assert(gl->extddata == NULL);
|
||||
assert(gl->extdsize == 0);
|
||||
assert(gl->flags == 0);
|
||||
assert(gl->time == 0);
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void
|
||||
grid_check_lines(__unused struct grid *gd)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
grid_check_is_clear(__unused struct grid *gd)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Store cell in entry. */
|
||||
@@ -363,6 +397,7 @@ grid_create(u_int sx, u_int sy, u_int hlimit)
|
||||
else
|
||||
gd->linedata = NULL;
|
||||
|
||||
grid_check_is_clear(gd);
|
||||
return (gd);
|
||||
}
|
||||
|
||||
|
||||
2
screen.c
2
screen.c
@@ -123,7 +123,7 @@ screen_reinit(struct screen *s)
|
||||
s->saved_cy = UINT_MAX;
|
||||
|
||||
screen_reset_tabs(s);
|
||||
|
||||
grid_check_is_clear(s->grid);
|
||||
grid_clear_lines(s->grid, s->grid->hsize, s->grid->sy, 8);
|
||||
|
||||
screen_clear_selection(s);
|
||||
|
||||
1
tmux.h
1
tmux.h
@@ -3323,6 +3323,7 @@ bitstr_t *fuzzy_match(const char *, const char *, u_int, u_int *);
|
||||
|
||||
/* grid.c */
|
||||
extern const struct grid_cell grid_default_cell;
|
||||
void grid_check_is_clear(struct grid *);
|
||||
void grid_empty_line(struct grid *, u_int, u_int);
|
||||
void grid_set_tab(struct grid_cell *, u_int);
|
||||
int grid_cells_equal(const struct grid_cell *, const struct grid_cell *);
|
||||
|
||||
Reference in New Issue
Block a user