diff options
Diffstat (limited to 'usr.bin/tmux/cmd-select-layout.c')
-rw-r--r-- | usr.bin/tmux/cmd-select-layout.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/usr.bin/tmux/cmd-select-layout.c b/usr.bin/tmux/cmd-select-layout.c index 1de208af714..a22249ffcae 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.9 2010/04/25 20:28:13 nicm Exp $ */ +/* $OpenBSD: cmd-select-layout.c,v 1.10 2010/06/29 03:30:13 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -79,13 +79,16 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_ctx *ctx) layout = wl->window->lastlayout; if (layout == -1) return (0); - } else if ((layout = layout_set_lookup(data->arg)) == -1) { - ctx->error(ctx, "unknown layout or ambiguous: %s", data->arg); - return (-1); + } else if ((layout = layout_set_lookup(data->arg)) != -1) { + layout = layout_set_select(wl->window, layout); + ctx->info(ctx, "arranging in: %s", layout_set_name(layout)); + } else { + if (layout_parse(wl->window, data->arg) == -1) { + ctx->error(ctx, "can't set layout: %s", data->arg); + return (-1); + } + ctx->info(ctx, "arranging in: %s", data->arg); } - layout = layout_set_select(wl->window, layout); - ctx->info(ctx, "arranging in: %s", layout_set_name(layout)); - return (0); } |