From 63b2547a0255c42bff405ca34577de240a99b736 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 15 Oct 2016 00:09:30 +0000 Subject: Fire hooks on the simple notifys (window-renamed and session-renamed), the complicated ones get no hooks for now (more to come). --- cmd-find.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cmd-find.c') 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); -- cgit