summaryrefslogtreecommitdiffstats
path: root/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-11-15 23:19:51 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-11-15 23:19:51 +0000
commit57df44291634e1083fccf29ecccc8b1793647e50 (patch)
treec93759746d1f177de3bb0cca0909c6aa984bb81b /status.c
parent9f738dd2fe01b5b70c07280450eed32614c561c2 (diff)
Make window_pane_index work the same as window_index, from Ben Boeckel.
Diffstat (limited to 'status.c')
-rw-r--r--status.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/status.c b/status.c
index 86f7e8c9..487d3f56 100644
--- a/status.c
+++ b/status.c
@@ -372,6 +372,7 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl,
char ch, tmp[256], *ptr, *endptr, *freeptr;
size_t ptrlen;
long limit;
+ u_int idx;
if (s == NULL)
s = c->session;
@@ -422,8 +423,10 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl,
ptr = tmp;
goto do_replace;
case 'P':
+ if (window_pane_index(wp, &idx) != 0)
+ fatalx("index not found");
xsnprintf(
- tmp, sizeof tmp, "%u", window_pane_index(wl->window, wp));
+ tmp, sizeof tmp, "%u", idx);
ptr = tmp;
goto do_replace;
case 'S':