mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 16:43:11 +01:00
Look up indexes as number before name, makes more sense if windows are
named starting with numbers. From Thomas Adam.
This commit is contained in:
parent
69f292a90e
commit
3909aff06a
8
cmd.c
8
cmd.c
@ -781,15 +781,15 @@ cmd_lookup_index(struct session *s, const char *name, int *ambiguous)
|
|||||||
const char *errstr;
|
const char *errstr;
|
||||||
u_int idx;
|
u_int idx;
|
||||||
|
|
||||||
|
idx = strtonum(name, 0, INT_MAX, &errstr);
|
||||||
|
if (errstr == NULL)
|
||||||
|
return (idx);
|
||||||
|
|
||||||
if ((wl = cmd_lookup_window(s, name, ambiguous)) != NULL)
|
if ((wl = cmd_lookup_window(s, name, ambiguous)) != NULL)
|
||||||
return (wl->idx);
|
return (wl->idx);
|
||||||
if (*ambiguous)
|
if (*ambiguous)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
idx = strtonum(name, 0, INT_MAX, &errstr);
|
|
||||||
if (errstr == NULL)
|
|
||||||
return (idx);
|
|
||||||
|
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user