=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/grid.c,v retrieving revision 1.53 retrieving revision 1.54 diff -c -r1.53 -r1.54 *** src/usr.bin/tmux/grid.c 2016/07/15 00:42:56 1.53 --- src/usr.bin/tmux/grid.c 2016/07/15 00:49:08 1.54 *************** *** 1,4 **** ! /* $OpenBSD: grid.c,v 1.53 2016/07/15 00:42:56 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: grid.c,v 1.54 2016/07/15 00:49:08 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott *************** *** 43,50 **** 0, { .data = { 0, 8, 8, ' ' } } }; - int grid_check_y(struct grid *, u_int); - void grid_reflow_copy(struct grid_line *, u_int, struct grid_line *l, u_int, u_int); void grid_reflow_join(struct grid *, u_int *, struct grid_line *, u_int); --- 43,48 ---- *************** *** 64,70 **** } /* Check grid y position. */ ! int grid_check_y(struct grid *gd, u_int py) { if ((py) >= (gd)->hsize + (gd)->sy) { --- 62,68 ---- } /* Check grid y position. */ ! static int grid_check_y(struct grid *gd, u_int py) { if ((py) >= (gd)->hsize + (gd)->sy) { *************** *** 74,79 **** --- 72,92 ---- return (0); } + /* Compare grid cells. Return 1 if equal, 0 if not. */ + int + grid_cells_equal(const struct grid_cell *gca, const struct grid_cell *gcb) + { + if (gca->fg != gcb->fg || gca->bg != gcb->bg) + return (0); + if (gca->attr != gcb->attr || gca->flags != gcb->flags) + return (0); + if (gca->data.width != gcb->data.width) + return (0); + if (gca->data.size != gcb->data.size) + return (0); + return (memcmp(gca->data.data, gcb->data.data, gca->data.size) == 0); + } + /* Create a new grid. */ struct grid * grid_create(u_int sx, u_int sy, u_int hlimit) *************** *** 131,137 **** for (xx = 0; xx < gla->cellsize; xx++) { grid_get_cell(ga, xx, yy, &gca); grid_get_cell(gb, xx, yy, &gcb); ! if (memcmp(&gca, &gcb, sizeof (struct grid_cell)) != 0) return (1); } } --- 144,150 ---- for (xx = 0; xx < gla->cellsize; xx++) { grid_get_cell(ga, xx, yy, &gca); grid_get_cell(gb, xx, yy, &gcb); ! if (!grid_cells_equal(&gca, &gcb)) return (1); } } *************** *** 305,310 **** --- 318,325 ---- (gc->bg & COLOUR_FLAG_RGB))) extended = 1; if (extended) { + gl->flags |= GRID_LINE_EXTENDED; + if (~gce->flags & GRID_FLAG_EXTENDED) { gl->extddata = xreallocarray(gl->extddata, gl->extdsize + 1, sizeof *gl->extddata);