mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Sync OpenBSD patchset 780:
Add a last-pane command (bound to ; by default). Requested ages ago by somebody whose name I have forgotten.
This commit is contained in:
		
							
								
								
									
										16
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								window.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: window.c,v 1.139 2010-10-24 01:32:35 tcunha Exp $ */
 | 
			
		||||
/* $Id: window.c,v 1.140 2010-10-24 01:34:30 tcunha Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -322,6 +322,7 @@ window_resize(struct window *w, u_int sx, u_int sy)
 | 
			
		||||
void
 | 
			
		||||
window_set_active_pane(struct window *w, struct window_pane *wp)
 | 
			
		||||
{
 | 
			
		||||
	w->last = w->active;
 | 
			
		||||
	w->active = wp;
 | 
			
		||||
	while (!window_pane_visible(w->active)) {
 | 
			
		||||
		w->active = TAILQ_PREV(w->active, window_panes, entry);
 | 
			
		||||
@@ -366,10 +367,15 @@ void
 | 
			
		||||
window_remove_pane(struct window *w, struct window_pane *wp)
 | 
			
		||||
{
 | 
			
		||||
	if (wp == w->active) {
 | 
			
		||||
		w->active = TAILQ_PREV(wp, window_panes, entry);
 | 
			
		||||
		if (w->active == NULL)
 | 
			
		||||
			w->active = TAILQ_NEXT(wp, entry);
 | 
			
		||||
	}
 | 
			
		||||
		w->active = w->last;
 | 
			
		||||
		w->last = NULL;
 | 
			
		||||
		if (w->active == NULL) {
 | 
			
		||||
			w->active = TAILQ_PREV(wp, window_panes, entry);
 | 
			
		||||
			if (w->active == NULL)
 | 
			
		||||
				w->active = TAILQ_NEXT(wp, entry);
 | 
			
		||||
		}
 | 
			
		||||
	} else if (wp == w->last)
 | 
			
		||||
		w->last = NULL;
 | 
			
		||||
 | 
			
		||||
	TAILQ_REMOVE(&w->panes, wp, entry);
 | 
			
		||||
	window_pane_destroy(wp);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user