summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tmux/cmd-select-layout.c5
-rw-r--r--usr.bin/tmux/layout-custom.c19
2 files changed, 19 insertions, 5 deletions
diff --git a/usr.bin/tmux/cmd-select-layout.c b/usr.bin/tmux/cmd-select-layout.c
index 4741f5128d2..66a1e94176f 100644
--- a/usr.bin/tmux/cmd-select-layout.c
+++ b/usr.bin/tmux/cmd-select-layout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-select-layout.c,v 1.12 2011/01/04 02:03:41 nicm Exp $ */
+/* $OpenBSD: cmd-select-layout.c,v 1.13 2012/01/30 20:57:02 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -105,6 +105,7 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_ctx *ctx)
layout = layout_set_next(wl->window);
else
layout = layout_set_previous(wl->window);
+ server_redraw_window(wl->window);
ctx->info(ctx, "arranging in: %s", layout_set_name(layout));
return (0);
}
@@ -115,6 +116,7 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_ctx *ctx)
layout = layout_set_lookup(args->argv[0]);
if (layout != -1) {
layout = layout_set_select(wl->window, layout);
+ server_redraw_window(wl->window);
ctx->info(ctx, "arranging in: %s", layout_set_name(layout));
return (0);
}
@@ -125,6 +127,7 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_ctx *ctx)
ctx->error(ctx, "can't set layout: %s", layoutname);
return (-1);
}
+ server_redraw_window(wl->window);
ctx->info(ctx, "arranging in: %s", layoutname);
return (0);
}
diff --git a/usr.bin/tmux/layout-custom.c b/usr.bin/tmux/layout-custom.c
index 717250ca103..d555a2d1cd3 100644
--- a/usr.bin/tmux/layout-custom.c
+++ b/usr.bin/tmux/layout-custom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: layout-custom.c,v 1.2 2011/06/05 10:53:05 nicm Exp $ */
+/* $OpenBSD: layout-custom.c,v 1.3 2012/01/30 20:57:02 nicm Exp $ */
/*
* Copyright (c) 2010 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -79,8 +79,13 @@ layout_append(struct layout_cell *lc, char *buf, size_t len)
if (len == 0)
return (-1);
- tmplen = xsnprintf(tmp, sizeof tmp,
- "%ux%u,%u,%u", lc->sx, lc->sy, lc->xoff, lc->yoff);
+ if (lc->wp != NULL) {
+ tmplen = xsnprintf(tmp, sizeof tmp, "%ux%u,%u,%u,%u",
+ lc->sx, lc->sy, lc->xoff, lc->yoff, lc->wp->id);
+ } else {
+ tmplen = xsnprintf(tmp, sizeof tmp, "%ux%u,%u,%u",
+ lc->sx, lc->sy, lc->xoff, lc->yoff);
+ }
if (tmplen > (sizeof tmp) - 1)
return (-1);
if (strlcat(buf, tmp, len) >= len)
@@ -202,7 +207,8 @@ layout_construct(struct layout_cell *lcparent, const char **layout)
if (!isdigit((u_char) **layout))
return (NULL);
- if (sscanf(*layout, "%ux%u,%u,%u", &sx, &sy, &xoff, &yoff) != 4)
+ if (sscanf(*layout, "%ux%u,%u,%u,%*u", &sx, &sy, &xoff, &yoff) != 5 &&
+ sscanf(*layout, "%ux%u,%u,%u", &sx, &sy, &xoff, &yoff) != 4)
return (NULL);
while (isdigit((u_char) **layout))
@@ -222,6 +228,11 @@ layout_construct(struct layout_cell *lcparent, const char **layout)
(*layout)++;
while (isdigit((u_char) **layout))
(*layout)++;
+ if (**layout == ',') {
+ (*layout)++;
+ while (isdigit((u_char) **layout))
+ (*layout)++;
+ }
lc = layout_create_cell(lcparent);
lc->sx = sx;