From 3909aff06aa6de748ae057cab1e723eec2387edd Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 21 Apr 2015 22:42:27 +0000 Subject: [PATCH] Look up indexes as number before name, makes more sense if windows are named starting with numbers. From Thomas Adam. --- cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd.c b/cmd.c index dd1a0a7b..991e079b 100644 --- a/cmd.c +++ b/cmd.c @@ -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); }