mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	Sync OpenBSD patchset 1122:
Use a predefined structure for not-space cells used to set attributes.
This commit is contained in:
		
							
								
								
									
										1
									
								
								grid.c
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								grid.c
									
									
									
									
									
								
							@@ -36,6 +36,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Default grid cell data. */
 | 
					/* Default grid cell data. */
 | 
				
			||||||
const struct grid_cell grid_default_cell = { 0, 0, 8, 8, ' ' };
 | 
					const struct grid_cell grid_default_cell = { 0, 0, 8, 8, ' ' };
 | 
				
			||||||
 | 
					const struct grid_cell grid_marker_cell = { 0, 0, 8, 8, '_' };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define grid_put_cell(gd, px, py, gc) do {			\
 | 
					#define grid_put_cell(gd, px, py, gc) do {			\
 | 
				
			||||||
	memcpy(&gd->linedata[py].celldata[px], 			\
 | 
						memcpy(&gd->linedata[py].celldata[px], 			\
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -202,9 +202,8 @@ screen_redraw_screen(struct client *c, int status_only, int borders_only)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Set up pane border attributes. */
 | 
						/* Set up pane border attributes. */
 | 
				
			||||||
	memcpy(&other_gc, &grid_default_cell, sizeof other_gc);
 | 
						memcpy(&other_gc, &grid_marker_cell, sizeof other_gc);
 | 
				
			||||||
	memcpy(&active_gc, &grid_default_cell, sizeof active_gc);
 | 
						memcpy(&active_gc, &grid_marker_cell, sizeof active_gc);
 | 
				
			||||||
	active_gc.data = other_gc.data = 'x'; /* not space */
 | 
					 | 
				
			||||||
	active_gc.attr = other_gc.attr = GRID_ATTR_CHARSET;
 | 
						active_gc.attr = other_gc.attr = GRID_ATTR_CHARSET;
 | 
				
			||||||
	fg = options_get_number(oo, "pane-border-fg");
 | 
						fg = options_get_number(oo, "pane-border-fg");
 | 
				
			||||||
	colour_set_fg(&other_gc, fg);
 | 
						colour_set_fg(&other_gc, fg);
 | 
				
			||||||
@@ -317,8 +316,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
 | 
				
			|||||||
	px -= len * 3;
 | 
						px -= len * 3;
 | 
				
			||||||
	py -= 2;
 | 
						py -= 2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	memcpy(&gc, &grid_default_cell, sizeof gc);
 | 
						memcpy(&gc, &grid_marker_cell, sizeof gc);
 | 
				
			||||||
	gc.data = '_'; /* not space */
 | 
					 | 
				
			||||||
	if (w->active == wp)
 | 
						if (w->active == wp)
 | 
				
			||||||
		colour_set_bg(&gc, active_colour);
 | 
							colour_set_bg(&gc, active_colour);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
@@ -345,8 +343,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
 | 
				
			|||||||
	tty_cursor(tty, xoff + wp->sx - len, yoff);
 | 
						tty_cursor(tty, xoff + wp->sx - len, yoff);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
draw_text:
 | 
					draw_text:
 | 
				
			||||||
	memcpy(&gc, &grid_default_cell, sizeof gc);
 | 
						memcpy(&gc, &grid_marker_cell, sizeof gc);
 | 
				
			||||||
	gc.data = '_'; /* not space */
 | 
					 | 
				
			||||||
	if (w->active == wp)
 | 
						if (w->active == wp)
 | 
				
			||||||
		colour_set_fg(&gc, active_colour);
 | 
							colour_set_fg(&gc, active_colour);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							@@ -1858,6 +1858,7 @@ int	 attributes_fromstring(const char *);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* grid.c */
 | 
					/* grid.c */
 | 
				
			||||||
extern const struct grid_cell grid_default_cell;
 | 
					extern const struct grid_cell grid_default_cell;
 | 
				
			||||||
 | 
					extern const struct grid_cell grid_marker_cell;
 | 
				
			||||||
struct grid *grid_create(u_int, u_int, u_int);
 | 
					struct grid *grid_create(u_int, u_int, u_int);
 | 
				
			||||||
void	 grid_destroy(struct grid *);
 | 
					void	 grid_destroy(struct grid *);
 | 
				
			||||||
int	 grid_compare(struct grid *, struct grid *);
 | 
					int	 grid_compare(struct grid *, struct grid *);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user