mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	Fix up winlink lists after swap-window.
This commit is contained in:
		@@ -48,7 +48,7 @@ cmd_swap_window_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	struct session		*src, *dst;
 | 
						struct session		*src, *dst;
 | 
				
			||||||
	struct session_group	*sg_src, *sg_dst;
 | 
						struct session_group	*sg_src, *sg_dst;
 | 
				
			||||||
	struct winlink		*wl_src, *wl_dst;
 | 
						struct winlink		*wl_src, *wl_dst;
 | 
				
			||||||
	struct window		*w;
 | 
						struct window		*w_src, *w_dst;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wl_src = item->state.sflag.wl;
 | 
						wl_src = item->state.sflag.wl;
 | 
				
			||||||
	src = item->state.sflag.s;
 | 
						src = item->state.sflag.s;
 | 
				
			||||||
@@ -67,9 +67,15 @@ cmd_swap_window_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	if (wl_dst->window == wl_src->window)
 | 
						if (wl_dst->window == wl_src->window)
 | 
				
			||||||
		return (CMD_RETURN_NORMAL);
 | 
							return (CMD_RETURN_NORMAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	w = wl_dst->window;
 | 
						w_dst = wl_dst->window;
 | 
				
			||||||
	wl_dst->window = wl_src->window;
 | 
						TAILQ_REMOVE(&w_dst->winlinks, wl_dst, wentry);
 | 
				
			||||||
	wl_src->window = w;
 | 
						w_src = wl_src->window;
 | 
				
			||||||
 | 
						TAILQ_REMOVE(&w_src->winlinks, wl_src, wentry);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						wl_dst->window = w_src;
 | 
				
			||||||
 | 
						TAILQ_INSERT_TAIL(&w_src->winlinks, wl_dst, wentry);
 | 
				
			||||||
 | 
						wl_src->window = w_dst;
 | 
				
			||||||
 | 
						TAILQ_INSERT_TAIL(&w_dst->winlinks, wl_src, wentry);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!args_has(self->args, 'd')) {
 | 
						if (!args_has(self->args, 'd')) {
 | 
				
			||||||
		session_select(dst, wl_dst->idx);
 | 
							session_select(dst, wl_dst->idx);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user