summaryrefslogtreecommitdiffstats
path: root/layout-custom.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-06-05 10:53:05 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-06-05 10:53:05 +0000
commit2b60c648c4e0202ca2743fe958e0eabfc0479f55 (patch)
treed100a1acc4a275a6290eb01a50268eef7bf0b4a4 /layout-custom.c
parentf537870909c024ff5aaa7b9d15f3af469811ab3c (diff)
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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/layout-custom.c b/layout-custom.c
index 617e3170..9fb9cebd 100644
--- a/layout-custom.c
+++ b/layout-custom.c
@@ -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)