summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-find.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-05-08 18:05:04 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-05-08 18:05:04 +0000
commitbae7cc96081431691d54e0b15a540ffb4cae5d29 (patch)
tree294cb8856601c53f819be4df6f5d2add7f12d5d2 /usr.bin/tmux/cmd-find.c
parentc9f9e059ab026b9dc5a123923ac387486e5c17cd (diff)
Adjust how mouse targets are found so they always have a session, window
and pane.
Diffstat (limited to 'usr.bin/tmux/cmd-find.c')
-rw-r--r--usr.bin/tmux/cmd-find.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-find.c b/usr.bin/tmux/cmd-find.c
index f2ee855c07a..bdf14540efd 100644
--- a/usr.bin/tmux/cmd-find.c
+++ b/usr.bin/tmux/cmd-find.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-find.c,v 1.71 2019/03/15 15:20:00 nicm Exp $ */
+/* $OpenBSD: cmd-find.c,v 1.72 2019/05/08 18:05:03 nicm Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1040,12 +1040,16 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
switch (type) {
case CMD_FIND_PANE:
fs->wp = cmd_mouse_pane(m, &fs->s, &fs->wl);
- if (fs->wp != NULL)
+ if (fs->wp != NULL) {
fs->w = fs->wl->window;
- break;
+ break;
+ }
+ /* FALLTHROUGH */
case CMD_FIND_WINDOW:
case CMD_FIND_SESSION:
fs->wl = cmd_mouse_window(m, &fs->s);
+ if (fs->wl == NULL && fs->s != NULL)
+ fs->wl = fs->s->curw;
if (fs->wl != NULL) {
fs->w = fs->wl->window;
fs->wp = fs->w->active;