diff options
author | 2010-06-29 03:30:13 +0000 | |
---|---|---|
committer | 2010-06-29 03:30:13 +0000 | |
commit | f4611a41b12f9c741ad61daaf610ff3b262fec31 (patch) | |
tree | 259ea9215e4c30d9502b955e871b33ace9b75670 /usr.bin/tmux/cmd-select-layout.c | |
parent | correct some minor style violations (diff) | |
download | wireguard-openbsd-f4611a41b12f9c741ad61daaf610ff3b262fec31.tar.xz wireguard-openbsd-f4611a41b12f9c741ad61daaf610ff3b262fec31.zip |
Custom layouts. list-windows command displays the layout as a string (such as
"bb62,159x48,0,0{79x48,0,0,79x48,80,0}") and it can be applied to another
window (with the same number of panes or fewer) using select-layout.
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); } |