diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2011-06-05 10:53:05 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2011-06-05 10:53:05 +0000 |
commit | 2b60c648c4e0202ca2743fe958e0eabfc0479f55 (patch) | |
tree | d100a1acc4a275a6290eb01a50268eef7bf0b4a4 /cmd.c | |
parent | f537870909c024ff5aaa7b9d15f3af469811ab3c (diff) | |
download | rtmux-2b60c648c4e0202ca2743fe958e0eabfc0479f55.tar.gz rtmux-2b60c648c4e0202ca2743fe958e0eabfc0479f55.tar.bz2 rtmux-2b60c648c4e0202ca2743fe958e0eabfc0479f55.zip |
Get rid of the layout string code which tries to walk through the layout
hierarchy and instead just look at what panes are actually in the window.
Diffstat (limited to 'cmd.c')
-rw-r--r-- | cmd.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -1058,12 +1058,11 @@ struct winlink * cmd_find_pane(struct cmd_ctx *ctx, const char *arg, struct session **sp, struct window_pane **wpp) { - struct session *s; - struct winlink *wl; - struct layout_cell *lc; - const char *period, *errstr; - char *winptr, *paneptr; - u_int idx; + struct session *s; + struct winlink *wl; + const char *period, *errstr; + char *winptr, *paneptr; + u_int idx; /* Get the current session. */ if ((s = cmd_current_session(ctx, 0)) == NULL) { @@ -1119,11 +1118,10 @@ cmd_find_pane(struct cmd_ctx *ctx, lookup_string: /* Try pane string description. */ - if ((lc = layout_find_string(wl->window, paneptr)) == NULL) { + if ((*wpp = window_find_string(wl->window, paneptr)) == NULL) { ctx->error(ctx, "can't find pane: %s", paneptr); goto error; } - *wpp = lc->wp; xfree(winptr); return (wl); @@ -1142,10 +1140,8 @@ no_period: lookup_window: /* Try pane string description. */ - if ((lc = layout_find_string(s->curw->window, arg)) != NULL) { - *wpp = lc->wp; + if ((*wpp = window_find_string(s->curw->window, arg)) != NULL) return (s->curw); - } /* Try as a window and use the active pane. */ if ((wl = cmd_find_window(ctx, arg, sp)) != NULL) |