mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 22:43:58 +00:00
Sync OpenBSD patchset 732:
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.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* $Id: cmd-select-layout.c,v 1.11 2010-05-14 14:16:37 tcunha Exp $ */
|
||||
/* $Id: cmd-select-layout.c,v 1.12 2010-07-02 02:54:52 tcunha 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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user