mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
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:
22
window.c
22
window.c
@ -172,6 +172,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