diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-08-30 12:04:09 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-08-30 12:04:09 +0100 |
commit | 07c679b52d18f198a60da2bd5b9b743bac55680f (patch) | |
tree | 6e6db084991d889e61e0a5d53db1f8740a666ce6 /cmd-find.c | |
parent | 2e4e521629a8e23502551cfe13ea327e1971d1e2 (diff) | |
parent | b4c633cc40cd3d5963e24e6d560bc2c7f6553000 (diff) | |
download | rtmux-07c679b52d18f198a60da2bd5b9b743bac55680f.tar.gz rtmux-07c679b52d18f198a60da2bd5b9b743bac55680f.tar.bz2 rtmux-07c679b52d18f198a60da2bd5b9b743bac55680f.zip |
Merge branch 'master' into 2.6-rc
Diffstat (limited to 'cmd-find.c')
-rw-r--r-- | cmd-find.c | 58 |
1 files changed, 29 insertions, 29 deletions
@@ -727,9 +727,9 @@ cmd_find_log_state(const char *prefix, struct cmd_find_state *fs) /* Find state from a session. */ void -cmd_find_from_session(struct cmd_find_state *fs, struct session *s) +cmd_find_from_session(struct cmd_find_state *fs, struct session *s, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); fs->s = s; fs->wl = fs->s->curw; @@ -741,9 +741,9 @@ cmd_find_from_session(struct cmd_find_state *fs, struct session *s) /* Find state from a winlink. */ void -cmd_find_from_winlink(struct cmd_find_state *fs, struct winlink *wl) +cmd_find_from_winlink(struct cmd_find_state *fs, struct winlink *wl, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); fs->s = wl->session; fs->wl = wl; @@ -756,14 +756,14 @@ cmd_find_from_winlink(struct cmd_find_state *fs, struct winlink *wl) /* Find state from a session and window. */ int cmd_find_from_session_window(struct cmd_find_state *fs, struct session *s, - struct window *w) + struct window *w, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); fs->s = s; fs->w = w; if (cmd_find_best_winlink_with_window(fs) != 0) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); return (-1); } fs->wp = fs->w->active; @@ -774,17 +774,17 @@ cmd_find_from_session_window(struct cmd_find_state *fs, struct session *s, /* Find state from a window. */ int -cmd_find_from_window(struct cmd_find_state *fs, struct window *w) +cmd_find_from_window(struct cmd_find_state *fs, struct window *w, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); fs->w = w; if (cmd_find_best_session_with_window(fs) != 0) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); return (-1); } if (cmd_find_best_winlink_with_window(fs) != 0) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); return (-1); } fs->wp = fs->w->active; @@ -796,9 +796,9 @@ cmd_find_from_window(struct cmd_find_state *fs, struct window *w) /* Find state from a winlink and pane. */ void cmd_find_from_winlink_pane(struct cmd_find_state *fs, struct winlink *wl, - struct window_pane *wp) + struct window_pane *wp, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); fs->s = wl->session; fs->wl = wl; @@ -811,9 +811,9 @@ cmd_find_from_winlink_pane(struct cmd_find_state *fs, struct winlink *wl, /* Find state from a pane. */ int -cmd_find_from_pane(struct cmd_find_state *fs, struct window_pane *wp) +cmd_find_from_pane(struct cmd_find_state *fs, struct window_pane *wp, int flags) { - if (cmd_find_from_window(fs, wp->window) != 0) + if (cmd_find_from_window(fs, wp->window, flags) != 0) return (-1); fs->wp = wp; @@ -823,13 +823,13 @@ cmd_find_from_pane(struct cmd_find_state *fs, struct window_pane *wp) /* Find state from nothing. */ int -cmd_find_from_nothing(struct cmd_find_state *fs) +cmd_find_from_nothing(struct cmd_find_state *fs, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); - fs->s = cmd_find_best_session(NULL, 0, fs->flags); + fs->s = cmd_find_best_session(NULL, 0, flags); if (fs->s == NULL) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); return (-1); } fs->wl = fs->s->curw; @@ -843,16 +843,16 @@ cmd_find_from_nothing(struct cmd_find_state *fs) /* Find state from mouse. */ int -cmd_find_from_mouse(struct cmd_find_state *fs, struct mouse_event *m) +cmd_find_from_mouse(struct cmd_find_state *fs, struct mouse_event *m, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); if (!m->valid) return (-1); fs->wp = cmd_mouse_pane(m, &fs->s, &fs->wl); if (fs->wp == NULL) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); return (-1); } fs->w = fs->wl->window; @@ -863,7 +863,7 @@ cmd_find_from_mouse(struct cmd_find_state *fs, struct mouse_event *m) /* Find state from client. */ int -cmd_find_from_client(struct cmd_find_state *fs, struct client *c) +cmd_find_from_client(struct cmd_find_state *fs, struct client *c, int flags) { struct session *s; struct winlink *wl; @@ -871,14 +871,14 @@ cmd_find_from_client(struct cmd_find_state *fs, struct client *c) /* If no client, treat as from nothing. */ if (c == NULL) - return (cmd_find_from_nothing(fs)); + return (cmd_find_from_nothing(fs, flags)); /* If this is an attached client, all done. */ if (c->session != NULL) { - cmd_find_from_session(fs, c->session); + cmd_find_from_session(fs, c->session, flags); return (0); } - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); /* * If this is an unattached client running in a pane, we can use that @@ -937,12 +937,12 @@ unknown_pane: */ s = cmd_find_try_TMUX(c); if (s != NULL) { - cmd_find_from_session(fs, s); + cmd_find_from_session(fs, s, flags); return (0); } /* Otherwise we need to guess. */ - return (cmd_find_from_nothing(fs)); + return (cmd_find_from_nothing(fs, flags)); } /* @@ -988,7 +988,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item, } else if (cmd_find_valid_state(&item->shared->current)) { fs->current = &item->shared->current; log_debug("%s: current is from queue", __func__); - } else if (cmd_find_from_client(¤t, item->client) == 0) { + } else if (cmd_find_from_client(¤t, item->client, flags) == 0) { fs->current = ¤t; log_debug("%s: current is from client", __func__); } else { |