summaryrefslogtreecommitdiffstats
path: root/layout.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-04-30 21:17:06 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-04-30 21:17:06 +0000
commit044e6f766017cb065fdd4f8db492e1b29cd8b87d (patch)
treecf7694b60ada53e488cd34e110857060dc533384 /layout.c
parenta6f2d8233569b4dcb6e26935b33b20f796ce958c (diff)
previous-layout command.
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/layout.c b/layout.c
index ff5485eb..d10ccd2d 100644
--- a/layout.c
+++ b/layout.c
@@ -1,4 +1,4 @@
-/* $Id: layout.c,v 1.4 2009-04-30 16:27:29 nicm Exp $ */
+/* $Id: layout.c,v 1.5 2009-04-30 21:17:06 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -62,6 +62,21 @@ layout_next(struct window *w)
}
void
+layout_previous(struct window *w)
+{
+ if (w->layout == 0)
+ w->layout = nitems(layouts) - 1;
+ else
+ w->layout--;
+ if (w->layout == 0) {
+ /* XXX Special-case manual. */
+ window_fit_panes(w);
+ window_update_panes(w);
+ }
+ layout_refresh(w, 0);
+}
+
+void
layout_refresh(struct window *w, unused int active_changed)
{
layouts[w->layout].fn(w, active_changed);