diff options
author | nicm <nicm> | 2018-05-03 16:56:59 +0000 |
---|---|---|
committer | nicm <nicm> | 2018-05-03 16:56:59 +0000 |
commit | e24a077752106189e932be29eb71fe7fc40089b6 (patch) | |
tree | 0bfbdeddbbd2871c4b1e97c6ae18583bf43acabf /cmd-find.c | |
parent | 896c1da7da82e2dab6957bc0ce0327176735b631 (diff) | |
download | rtmux-e24a077752106189e932be29eb71fe7fc40089b6.tar.gz rtmux-e24a077752106189e932be29eb71fe7fc40089b6.tar.bz2 rtmux-e24a077752106189e932be29eb71fe7fc40089b6.zip |
Use window target if specified and exists even when looking for an
index, fixes neww -a with -t as well.
Diffstat (limited to 'cmd-find.c')
-rw-r--r-- | cmd-find.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -437,15 +437,15 @@ cmd_find_get_window_with_session(struct cmd_find_state *fs, const char *window) if (window[0] != '+' && window[0] != '-') { idx = strtonum(window, 0, INT_MAX, &errstr); if (errstr == NULL) { - if (fs->flags & CMD_FIND_WINDOW_INDEX) { - fs->idx = idx; - return (0); - } fs->wl = winlink_find_by_index(&fs->s->windows, idx); if (fs->wl != NULL) { fs->w = fs->wl->window; return (0); } + if (fs->flags & CMD_FIND_WINDOW_INDEX) { + fs->idx = idx; + return (0); + } } } @@ -1182,7 +1182,8 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item, /* This will fill in session, winlink and window. */ if (cmd_find_get_window(fs, window, window_only) != 0) goto no_window; - fs->wp = fs->wl->window->active; + if (fs->wl != NULL) /* can be NULL if index only */ + fs->wp = fs->wl->window->active; goto found; } |