=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/layout-custom.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/usr.bin/tmux/layout-custom.c 2010/06/29 03:30:13 1.1 +++ src/usr.bin/tmux/layout-custom.c 2011/06/05 10:53:05 1.2 @@ -1,4 +1,4 @@ -/* $OpenBSD: layout-custom.c,v 1.1 2010/06/29 03:30:13 nicm Exp $ */ +/* $OpenBSD: layout-custom.c,v 1.2 2011/06/05 10:53:05 nicm Exp $ */ /* * Copyright (c) 2010 Nicholas Marriott @@ -23,10 +23,21 @@ #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