mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Add a wrapper (struct style) around styles rather than using the
grid_cell directly. There will be some non-cell members soon.
This commit is contained in:
		@@ -90,6 +90,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
 | 
			
		||||
	struct window		*w = wl->window;
 | 
			
		||||
	struct session		*s = item->target.s;
 | 
			
		||||
	struct window_pane	*wp = item->target.wp, *lastwp, *markedwp;
 | 
			
		||||
	struct style		*sy = &wp->style;
 | 
			
		||||
	char			*pane_title;
 | 
			
		||||
	const char		*style;
 | 
			
		||||
 | 
			
		||||
@@ -142,19 +143,16 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (args_has(self->args, 'P') || args_has(self->args, 'g')) {
 | 
			
		||||
		if (args_has(args, 'P')) {
 | 
			
		||||
			style = args_get(args, 'P');
 | 
			
		||||
			memcpy(&wp->colgc, &grid_default_cell,
 | 
			
		||||
			    sizeof wp->colgc);
 | 
			
		||||
			if (style_parse(&grid_default_cell, &wp->colgc,
 | 
			
		||||
			    style) == -1) {
 | 
			
		||||
		if ((style = args_get(args, 'P')) != NULL) {
 | 
			
		||||
			style_set(sy, &grid_default_cell);
 | 
			
		||||
			if (style_parse(sy, &grid_default_cell, style) == -1) {
 | 
			
		||||
				cmdq_error(item, "bad style: %s", style);
 | 
			
		||||
				return (CMD_RETURN_ERROR);
 | 
			
		||||
			}
 | 
			
		||||
			wp->flags |= PANE_REDRAW;
 | 
			
		||||
		}
 | 
			
		||||
		if (args_has(self->args, 'g'))
 | 
			
		||||
			cmdq_print(item, "%s", style_tostring(&wp->colgc));
 | 
			
		||||
			cmdq_print(item, "%s", style_tostring(sy));
 | 
			
		||||
		return (CMD_RETURN_NORMAL);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user