mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Some more, and use of wp->window before wp NULL check in format.c.
This commit is contained in:
		@@ -73,7 +73,6 @@ cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item)
 | 
			
		||||
		return (CMD_RETURN_ERROR);
 | 
			
		||||
	s = item->target.s;
 | 
			
		||||
	wl = item->target.wl;
 | 
			
		||||
	w = wl->window;
 | 
			
		||||
	wp = item->target.wp;
 | 
			
		||||
 | 
			
		||||
	if (args_has(args, 'r'))
 | 
			
		||||
@@ -115,6 +114,7 @@ cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item)
 | 
			
		||||
		if (item->client == NULL)
 | 
			
		||||
			return (CMD_RETURN_NORMAL);
 | 
			
		||||
		if (wl != NULL && wp != NULL) {
 | 
			
		||||
			w = wl->window;
 | 
			
		||||
			if (window_push_zoom(w, args_has(self->args, 'Z')))
 | 
			
		||||
				server_redraw_window(w);
 | 
			
		||||
			window_redraw_active_switch(w, wp);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								format.c
									
									
									
									
									
								
							@@ -900,11 +900,12 @@ static void
 | 
			
		||||
format_cb_pane_at_top(struct format_tree *ft, struct format_entry *fe)
 | 
			
		||||
{
 | 
			
		||||
	struct window_pane	*wp = ft->wp;
 | 
			
		||||
	struct window		*w = wp->window;
 | 
			
		||||
	struct window		*w;
 | 
			
		||||
	int			 status, flag;
 | 
			
		||||
 | 
			
		||||
	if (wp == NULL)
 | 
			
		||||
		return;
 | 
			
		||||
	w = wp->window;
 | 
			
		||||
 | 
			
		||||
	status = options_get_number(w->options, "pane-border-status");
 | 
			
		||||
	if (status == PANE_STATUS_TOP)
 | 
			
		||||
@@ -919,11 +920,12 @@ static void
 | 
			
		||||
format_cb_pane_at_bottom(struct format_tree *ft, struct format_entry *fe)
 | 
			
		||||
{
 | 
			
		||||
	struct window_pane	*wp = ft->wp;
 | 
			
		||||
	struct window		*w = wp->window;
 | 
			
		||||
	struct window		*w;
 | 
			
		||||
	int			 status, flag;
 | 
			
		||||
 | 
			
		||||
	if (wp == NULL)
 | 
			
		||||
		return;
 | 
			
		||||
	w = wp->window;
 | 
			
		||||
 | 
			
		||||
	status = options_get_number(w->options, "pane-border-status");
 | 
			
		||||
	if (status == PANE_STATUS_BOTTOM)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								grid.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								grid.c
									
									
									
									
									
								
							@@ -1343,18 +1343,14 @@ grid_wrap_position(struct grid *gd, u_int px, u_int py, u_int *wx, u_int *wy)
 | 
			
		||||
void
 | 
			
		||||
grid_unwrap_position(struct grid *gd, u_int *px, u_int *py, u_int wx, u_int wy)
 | 
			
		||||
{
 | 
			
		||||
	u_int	yy, ax = 0, ay = 0;
 | 
			
		||||
	u_int	yy, ay = 0;
 | 
			
		||||
 | 
			
		||||
	for (yy = 0; yy < gd->hsize + gd->sy - 1; yy++) {
 | 
			
		||||
		if (ay == wy)
 | 
			
		||||
			break;
 | 
			
		||||
		if (gd->linedata[yy].flags & GRID_LINE_WRAPPED)
 | 
			
		||||
			ax += gd->linedata[yy].cellused;
 | 
			
		||||
		else {
 | 
			
		||||
			ax = 0;
 | 
			
		||||
		if (~gd->linedata[yy].flags & GRID_LINE_WRAPPED)
 | 
			
		||||
			ay++;
 | 
			
		||||
	}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * yy is now 0 on the unwrapped line which contains wx. Walk forwards
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user