version 1.36, 2012/07/10 11:53:01 |
version 1.37, 2013/03/22 16:00:26 |
|
|
if (alert && ((wl = session_next_alert(wl)) == NULL)) |
if (alert && ((wl = session_next_alert(wl)) == NULL)) |
return (-1); |
return (-1); |
} |
} |
if (wl == s->curw) |
return (session_set_current(s, wl)); |
return (1); |
|
winlink_stack_remove(&s->lastw, wl); |
|
winlink_stack_push(&s->lastw, s->curw); |
|
s->curw = wl; |
|
winlink_clear_flags(wl); |
|
return (0); |
|
} |
} |
|
|
struct winlink * |
struct winlink * |
|
|
if (alert && (wl = session_previous_alert(wl)) == NULL) |
if (alert && (wl = session_previous_alert(wl)) == NULL) |
return (-1); |
return (-1); |
} |
} |
if (wl == s->curw) |
return (session_set_current(s, wl)); |
return (1); |
|
winlink_stack_remove(&s->lastw, wl); |
|
winlink_stack_push(&s->lastw, s->curw); |
|
s->curw = wl; |
|
winlink_clear_flags(wl); |
|
return (0); |
|
} |
} |
|
|
/* Move session to specific window. */ |
/* Move session to specific window. */ |
|
|
struct winlink *wl; |
struct winlink *wl; |
|
|
wl = winlink_find_by_index(&s->windows, idx); |
wl = winlink_find_by_index(&s->windows, idx); |
if (wl == NULL) |
return (session_set_current(s, wl)); |
return (-1); |
|
if (wl == s->curw) |
|
return (1); |
|
winlink_stack_remove(&s->lastw, wl); |
|
winlink_stack_push(&s->lastw, s->curw); |
|
s->curw = wl; |
|
winlink_clear_flags(wl); |
|
return (0); |
|
} |
} |
|
|
/* Move session to last used window. */ |
/* Move session to last used window. */ |
|
|
struct winlink *wl; |
struct winlink *wl; |
|
|
wl = TAILQ_FIRST(&s->lastw); |
wl = TAILQ_FIRST(&s->lastw); |
|
if (wl == NULL) |
|
return (-1); |
|
if (wl == s->curw) |
|
return (1); |
|
|
|
return (session_set_current(s, wl)); |
|
} |
|
|
|
/* Set current winlink to wl .*/ |
|
int |
|
session_set_current(struct session *s, struct winlink *wl) |
|
{ |
if (wl == NULL) |
if (wl == NULL) |
return (-1); |
return (-1); |
if (wl == s->curw) |
if (wl == s->curw) |