aboutsummaryrefslogtreecommitdiff
path: root/cmd.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2011-06-23 19:21:26 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2011-06-23 19:21:26 +0000
commitfa0f10d77aa9506285ced61f4ae93728b2f8cb0e (patch)
tree7a543309ba353fd64a10a580dee9768632f8f0ef /cmd.c
parentddade84e0a405c8013473e0b1fc18da795f5cc99 (diff)
downloadrtmux-fa0f10d77aa9506285ced61f4ae93728b2f8cb0e.tar.gz
rtmux-fa0f10d77aa9506285ced61f4ae93728b2f8cb0e.tar.bz2
rtmux-fa0f10d77aa9506285ced61f4ae93728b2f8cb0e.zip
PatchSet 923
Date: 2011/06/05 11:53:05 Author: nicm Branch: HEAD Tag: (none) Log: 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.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/cmd.c b/cmd.c
index 247910c1..fa645bfa 100644
--- a/cmd.c
+++ b/cmd.c
@@ -1,4 +1,4 @@
-/* $Id: cmd.c,v 1.153 2011-05-18 20:30:36 tcunha Exp $ */
+/* $Id$ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1057,12 +1057,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) {
@@ -1118,11 +1117,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);
@@ -1141,10 +1139,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)