When a pane is found containing the match data, switch to that pane as well
as the window.
---
 trunk/cmd-find-window.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/trunk/cmd-find-window.c b/trunk/cmd-find-window.c
index 2c84ccc..07d506b 100644
--- a/trunk/cmd-find-window.c
+++ b/trunk/cmd-find-window.c
@@ -200,7 +200,9 @@ out:
 void
 cmd_find_window_callback(struct window_choose_data *cdata)
 {
-       struct session  *s;
+       struct session          *s;
+       struct window_pane      *wp;
+       const char              *find_pane_id;
 
        if (cdata == NULL)
                return;
@@ -209,6 +211,11 @@ cmd_find_window_callback(struct window_choose_data *cdata)
        if (!session_alive(s))
                return;
 
+       find_pane_id = format_find(cdata->ft, "window_find_matches_pane");
+       wp = window_pane_at_index(cdata->wl->window, strtonum(find_pane_id, 0, 
INT_MAX, NULL));
+       if (wp != NULL && window_pane_visible(wp))
+               window_set_active_pane(cdata->wl->window, wp);
+
        if (session_select(s, cdata->idx) == 0) {
                server_redraw_session(s);
                recalculate_sizes();
-- 
1.7.11.2


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to