aboutsummaryrefslogtreecommitdiff
path: root/layout-custom.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 /layout-custom.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 'layout-custom.c')
-rw-r--r--layout-custom.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/layout-custom.c b/layout-custom.c
index 50c4627b..b4a6d833 100644
--- a/layout-custom.c
+++ b/layout-custom.c
@@ -1,4 +1,4 @@
-/* $Id: layout-custom.c,v 1.1 2010-07-02 02:54:52 tcunha Exp $ */
+/* $Id$ */
/*
* Copyright (c) 2010 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -23,11 +23,22 @@
#include "tmux.h"
+struct layout_cell *layout_find_bottomright(struct layout_cell *);
u_short layout_checksum(const char *);
int layout_append(struct layout_cell *, char *, size_t);
struct layout_cell *layout_construct(struct layout_cell *, const char **);
void layout_assign(struct window_pane **, struct layout_cell *);
+/* Find the bottom-right cell. */
+struct layout_cell *
+layout_find_bottomright(struct layout_cell *lc)
+{
+ if (lc->type == LAYOUT_WINDOWPANE)
+ return (lc);
+ lc = TAILQ_LAST(&lc->cells, layout_cells);
+ return (layout_find_bottomright(lc));
+}
+
/* Calculate layout checksum. */
u_short
layout_checksum(const char *layout)