summaryrefslogtreecommitdiffstats
path: root/cmd-find.c
diff options
context:
space:
mode:
authornicm <nicm>2019-05-08 18:05:03 +0000
committernicm <nicm>2019-05-08 18:05:03 +0000
commita384245c5aa1b1be2a73d9b3318a4c0d5bfc5391 (patch)
treee3c600fc6eee93a34410bf28bb19abde751f1b09 /cmd-find.c
parent89db309e106cfdd901ab62243bc07f0b76ef41da (diff)
Adjust how mouse targets are found so they always have a session, window
and pane.
Diffstat (limited to 'cmd-find.c')
-rw-r--r--cmd-find.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd-find.c b/cmd-find.c
index 2fa53b9c..e5ef8b99 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -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;