mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Merge branch 'obsd-master'
This commit is contained in:
33
window.c
33
window.c
@ -48,6 +48,8 @@
|
||||
* it reaches zero.
|
||||
*/
|
||||
|
||||
ARRAY_DECL(window_pane_list, struct window_pane *);
|
||||
|
||||
/* Global window list. */
|
||||
struct windows windows;
|
||||
|
||||
@ -252,6 +254,21 @@ winlink_stack_remove(struct winlink_stack *stack, struct winlink *wl)
|
||||
}
|
||||
}
|
||||
|
||||
struct window *
|
||||
window_find_by_id_str(const char* s)
|
||||
{
|
||||
const char *errstr;
|
||||
u_int id;
|
||||
|
||||
if (*s != '@')
|
||||
return (NULL);
|
||||
|
||||
id = strtonum(s + 1, 0, UINT_MAX, &errstr);
|
||||
if (errstr != NULL)
|
||||
return (NULL);
|
||||
return (window_find_by_id(id));
|
||||
}
|
||||
|
||||
struct window *
|
||||
window_find_by_id(u_int id)
|
||||
{
|
||||
@ -652,7 +669,21 @@ window_printable_flags(struct session *s, struct winlink *wl)
|
||||
return (xstrdup(flags));
|
||||
}
|
||||
|
||||
/* Find pane in global tree by id. */
|
||||
struct window_pane *
|
||||
window_pane_find_by_id_str(const char *s)
|
||||
{
|
||||
const char *errstr;
|
||||
u_int id;
|
||||
|
||||
if (*s != '%')
|
||||
return (NULL);
|
||||
|
||||
id = strtonum(s + 1, 0, UINT_MAX, &errstr);
|
||||
if (errstr != NULL)
|
||||
return (NULL);
|
||||
return (window_pane_find_by_id(id));
|
||||
}
|
||||
|
||||
struct window_pane *
|
||||
window_pane_find_by_id(u_int id)
|
||||
{
|
||||
|
Reference in New Issue
Block a user