mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Correctly clear underscore colour in grid_get_cell1, also fix struct
grid_cell to avoid padding. Fixes increased memory use reported by Suraj N Kurapati.
This commit is contained in:
		@@ -565,7 +565,7 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
 | 
			
		||||
				cp++;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			/* Draw the cell to th current screen. */
 | 
			
		||||
			/* Draw the cell to the current screen. */
 | 
			
		||||
			screen_write_cell(&ctx[current], &sy.gc);
 | 
			
		||||
			width[current] += ud->width;
 | 
			
		||||
			continue;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								grid.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								grid.c
									
									
									
									
									
								
							@@ -37,12 +37,12 @@
 | 
			
		||||
 | 
			
		||||
/* Default grid cell data. */
 | 
			
		||||
const struct grid_cell grid_default_cell = {
 | 
			
		||||
	0, 0, 8, 8, 0, { { ' ' }, 0, 1, 1 }
 | 
			
		||||
	{ { ' ' }, 0, 1, 1 }, 0, 0, 8, 8, 0
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Cleared grid cell data. */
 | 
			
		||||
const struct grid_cell grid_cleared_cell = {
 | 
			
		||||
	GRID_FLAG_CLEARED, 0, 8, 8, 0, { { ' ' }, 0, 1, 1 }
 | 
			
		||||
	{ { ' ' }, 0, 1, 1 }, 0, GRID_FLAG_CLEARED, 8, 8, 0
 | 
			
		||||
};
 | 
			
		||||
static const struct grid_cell_entry grid_cleared_entry = {
 | 
			
		||||
	GRID_FLAG_CLEARED, { .data = { 0, 8, 8, ' ' } }
 | 
			
		||||
@@ -475,6 +475,7 @@ grid_get_cell1(struct grid_line *gl, u_int px, struct grid_cell *gc)
 | 
			
		||||
	gc->bg = gce->data.bg;
 | 
			
		||||
	if (gce->flags & GRID_FLAG_BG256)
 | 
			
		||||
		gc->bg |= COLOUR_FLAG_256;
 | 
			
		||||
	gc->us = 0;
 | 
			
		||||
	utf8_set(&gc->data, gce->data.data);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@ static const struct grid_cell *screen_write_combine(struct screen_write_ctx *,
 | 
			
		||||
		    const struct utf8_data *, u_int *);
 | 
			
		||||
 | 
			
		||||
static const struct grid_cell screen_write_pad_cell = {
 | 
			
		||||
	GRID_FLAG_PADDING, 0, 8, 8, 0, { { 0 }, 0, 0, 0 }
 | 
			
		||||
	{ { 0 }, 0, 0, 0 }, 0, GRID_FLAG_PADDING, 0, 8, 8
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct screen_write_collect_item {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								style.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								style.c
									
									
									
									
									
								
							@@ -30,7 +30,7 @@
 | 
			
		||||
 | 
			
		||||
/* Default style. */
 | 
			
		||||
static struct style style_default = {
 | 
			
		||||
	{ 0, 0, 8, 8, 0, { { ' ' }, 0, 1, 1 } },
 | 
			
		||||
	{ { { ' ' }, 0, 1, 1 }, 0, 0, 8, 8, 0  },
 | 
			
		||||
 | 
			
		||||
	8,
 | 
			
		||||
	STYLE_ALIGN_DEFAULT,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user