From e36fab2f7093e018de51af35e2c37b7a11201c2e Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 28 Apr 2015 12:09:24 +0000 Subject: [PATCH] If looking for an index, don't fill in window when given a session. --- cmd-find.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd-find.c b/cmd-find.c index e9d80cbe..ec4cf6c1 100644 --- a/cmd-find.c +++ b/cmd-find.c @@ -434,9 +434,11 @@ cmd_find_get_window(struct cmd_find_state *fs, const char *window) /* Otherwise try as a session itself. */ if (cmd_find_get_session(fs, window) == 0) { - fs->wl = fs->s->curw; - fs->idx = fs->wl->idx; - fs->w = fs->wl->window; + if (~fs->flags & CMD_FIND_WINDOW_INDEX) { + fs->wl = fs->s->curw; + fs->w = fs->wl->window; + fs->idx = fs->wl->idx; + } return (0); }