summaryrefslogtreecommitdiffstats
path: root/cmd-find.c
diff options
context:
space:
mode:
authornicm <nicm>2016-10-15 00:09:30 +0000
committernicm <nicm>2016-10-15 00:09:30 +0000
commit63b2547a0255c42bff405ca34577de240a99b736 (patch)
treec741a634cd1e1f645a626c53de81d8e591f62438 /cmd-find.c
parent9b3ae84993d2493ff0761efbcda0b9d188ed6d9e (diff)
Fire hooks on the simple notifys (window-renamed and session-renamed),
the complicated ones get no hooks for now (more to come).
Diffstat (limited to 'cmd-find.c')
-rw-r--r--cmd-find.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmd-find.c b/cmd-find.c
index 10f2fd04..21691f67 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -904,6 +904,23 @@ cmd_find_from_winlink(struct cmd_find_state *fs, struct session *s,
return (0);
}
+/* Find state from a session and window. */
+int
+cmd_find_from_session_window(struct cmd_find_state *fs, struct session *s,
+ struct window *w)
+{
+ cmd_find_clear_state(fs, NULL, 0);
+
+ fs->s = s;
+ fs->w = w;
+ if (cmd_find_best_winlink_with_window(fs) != 0)
+ return (-1);
+ fs->wp = fs->w->active;
+
+ cmd_find_log_state(__func__, fs);
+ return (0);
+}
+
/* Find state from a window. */
int
cmd_find_from_window(struct cmd_find_state *fs, struct window *w)
@@ -915,6 +932,7 @@ cmd_find_from_window(struct cmd_find_state *fs, struct window *w)
return (-1);
if (cmd_find_best_winlink_with_window(fs) != 0)
return (-1);
+ fs->wp = fs->w->active;
cmd_find_log_state(__func__, fs);
return (0);