Look up indexes as number before name, makes more sense if windows are

named starting with numbers. From Thomas Adam.
pull/1/head
nicm 2015-04-21 22:42:27 +00:00
parent 69f292a90e
commit 3909aff06a
1 changed files with 4 additions and 4 deletions

8
cmd.c
View File

@ -781,15 +781,15 @@ cmd_lookup_index(struct session *s, const char *name, int *ambiguous)
const char *errstr;
u_int idx;
idx = strtonum(name, 0, INT_MAX, &errstr);
if (errstr == NULL)
return (idx);
if ((wl = cmd_lookup_window(s, name, ambiguous)) != NULL)
return (wl->idx);
if (*ambiguous)
return (-1);
idx = strtonum(name, 0, INT_MAX, &errstr);
if (errstr == NULL)
return (idx);
return (-1);
}