mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Sync OpenBSD patchset 725:
Extend the -t:+ and -t:- window targets for next and previous window to accept an offset such as -t:+2. From Tiago Cunha.
This commit is contained in:
		
							
								
								
									
										24
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								window.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: window.c,v 1.132 2010-05-22 21:56:04 micahcowan Exp $ */
 | 
			
		||||
/* $Id: window.c,v 1.133 2010-06-22 23:29:05 tcunha Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -170,6 +170,28 @@ winlink_previous(struct winlink *wl)
 | 
			
		||||
	return (RB_PREV(winlinks, wwl, wl));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct winlink *
 | 
			
		||||
winlink_next_by_number(struct winlink *wl, int n)
 | 
			
		||||
{
 | 
			
		||||
	for (; n > 0; n--) {
 | 
			
		||||
		if ((wl = RB_NEXT(winlinks, wwl, wl)) == NULL)
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (wl);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct winlink *
 | 
			
		||||
winlink_previous_by_number(struct winlink *wl, int n)
 | 
			
		||||
{
 | 
			
		||||
	for (; n > 0; n--) {
 | 
			
		||||
		if ((wl = RB_PREV(winlinks, wwl, wl)) == NULL)
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (wl);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
winlink_stack_push(struct winlink_stack *stack, struct winlink *wl)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user