diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-08-29 11:13:54 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-08-29 11:13:54 +0100 |
commit | 91d6bff8b83cea34d348172db56dd28baafbda80 (patch) | |
tree | 5e275e0eba9cc056652abcfc478df2f4532fa5f5 /cmd-find.c | |
parent | 5cdccf78a1baa5757a42e78e6b89266f89a37034 (diff) | |
parent | 7d3bf6453ec43f03ff98231c5ced5a2979550f84 (diff) | |
download | rtmux-91d6bff8b83cea34d348172db56dd28baafbda80.tar.gz rtmux-91d6bff8b83cea34d348172db56dd28baafbda80.tar.bz2 rtmux-91d6bff8b83cea34d348172db56dd28baafbda80.zip |
Merge branch 'master' of github.com:tmux/tmux
Diffstat (limited to 'cmd-find.c')
-rw-r--r-- | cmd-find.c | 32 |
1 files changed, 13 insertions, 19 deletions
@@ -509,7 +509,7 @@ cmd_find_get_pane(struct cmd_find_state *fs, const char *pane, int only) /* Check for pane ids starting with %. */ if (*pane == '%') { fs->wp = window_pane_find_by_id_str(pane); - if (fs->wp == NULL || window_pane_outside(fs->wp)) + if (fs->wp == NULL) return (-1); fs->w = fs->wp->window; return (cmd_find_best_session_with_window(fs)); @@ -546,7 +546,7 @@ cmd_find_get_pane_with_session(struct cmd_find_state *fs, const char *pane) /* Check for pane ids starting with %. */ if (*pane == '%') { fs->wp = window_pane_find_by_id_str(pane); - if (fs->wp == NULL || window_pane_outside(fs->wp)) + if (fs->wp == NULL) return (-1); fs->w = fs->wp->window; return (cmd_find_best_winlink_with_window(fs)); @@ -578,7 +578,7 @@ cmd_find_get_pane_with_window(struct cmd_find_state *fs, const char *pane) /* Check for pane ids starting with %. */ if (*pane == '%') { fs->wp = window_pane_find_by_id_str(pane); - if (fs->wp == NULL || window_pane_outside(fs->wp)) + if (fs->wp == NULL) return (-1); if (fs->wp->window != fs->w) return (-1); @@ -590,27 +590,27 @@ cmd_find_get_pane_with_window(struct cmd_find_state *fs, const char *pane) if (fs->w->last == NULL) return (-1); fs->wp = fs->w->last; - if (fs->wp == NULL || window_pane_outside(fs->wp)) + if (fs->wp == NULL) return (-1); return (0); } else if (strcmp(pane, "{up-of}") == 0) { fs->wp = window_pane_find_up(fs->w->active); - if (fs->wp == NULL || window_pane_outside(fs->wp)) + if (fs->wp == NULL) return (-1); return (0); } else if (strcmp(pane, "{down-of}") == 0) { fs->wp = window_pane_find_down(fs->w->active); - if (fs->wp == NULL || window_pane_outside(fs->wp)) + if (fs->wp == NULL) return (-1); return (0); } else if (strcmp(pane, "{left-of}") == 0) { fs->wp = window_pane_find_left(fs->w->active); - if (fs->wp == NULL || window_pane_outside(fs->wp)) + if (fs->wp == NULL) return (-1); return (0); } else if (strcmp(pane, "{right-of}") == 0) { fs->wp = window_pane_find_right(fs->w->active); - if (fs->wp == NULL || window_pane_outside(fs->wp)) + if (fs->wp == NULL) return (-1); return (0); } @@ -626,7 +626,7 @@ cmd_find_get_pane_with_window(struct cmd_find_state *fs, const char *pane) fs->wp = window_pane_next_by_number(fs->w, wp, n); else fs->wp = window_pane_previous_by_number(fs->w, wp, n); - if (fs->wp != NULL && !window_pane_outside(fs->wp)) + if (fs->wp != NULL) return (0); } @@ -634,13 +634,13 @@ cmd_find_get_pane_with_window(struct cmd_find_state *fs, const char *pane) idx = strtonum(pane, 0, INT_MAX, &errstr); if (errstr == NULL) { fs->wp = window_pane_at_index(fs->w, idx); - if (fs->wp != NULL && !window_pane_outside(fs->wp)) + if (fs->wp != NULL) return (0); } /* Try as a description. */ fs->wp = window_find_string(fs->w, pane); - if (fs->wp != NULL && !window_pane_outside(fs->wp)) + if (fs->wp != NULL) return (0); return (-1); @@ -688,9 +688,7 @@ cmd_find_valid_state(struct cmd_find_state *fs) if (fs->w != fs->wl->window) return (0); - if (!window_has_pane(fs->w, fs->wp)) - return (0); - return (!window_pane_outside(fs->wp)); + return (window_has_pane(fs->w, fs->wp)); } /* Copy a state. */ @@ -817,10 +815,6 @@ cmd_find_from_pane(struct cmd_find_state *fs, struct window_pane *wp) { if (cmd_find_from_window(fs, wp->window) != 0) return (-1); - if (window_pane_outside(wp)) { - cmd_find_clear_state(fs, 0); - return (-1); - } fs->wp = wp; cmd_find_log_state(__func__, fs); @@ -1015,7 +1009,7 @@ 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 && !window_pane_outside(fs->wp)) + if (fs->wp != NULL) fs->w = fs->wl->window; break; case CMD_FIND_WINDOW: |