summaryrefslogtreecommitdiffstats
path: root/cmd-select-layout.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2013-01-17 00:11:22 +0000
committerNicholas Marriott <nicm@openbsd.org>2013-01-17 00:11:22 +0000
commite33ba57c13139bc9ae6e92be169de6dc322e38eb (patch)
treea67fba8332c545f71c2a25480ef1d367b69d01b1 /cmd-select-layout.c
parent44f8e1caffce2e887682c3314ee22becc09e1d3c (diff)
Remove the layout undo/redo code which never really worked.
Diffstat (limited to 'cmd-select-layout.c')
-rw-r--r--cmd-select-layout.c45
1 files changed, 10 insertions, 35 deletions
diff --git a/cmd-select-layout.c b/cmd-select-layout.c
index 982c0b27..3ca8766e 100644
--- a/cmd-select-layout.c
+++ b/cmd-select-layout.c
@@ -29,8 +29,8 @@ enum cmd_retval cmd_select_layout_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_select_layout_entry = {
"select-layout", "selectl",
- "nprut:", 0, 1,
- "[-npUu] " CMD_TARGET_WINDOW_USAGE " [layout-name]",
+ "npt:", 0, 1,
+ "[-np] " CMD_TARGET_WINDOW_USAGE " [layout-name]",
0,
cmd_select_layout_key_binding,
NULL,
@@ -76,14 +76,6 @@ cmd_select_layout_key_binding(struct cmd *self, int key)
case '5' | KEYC_ESCAPE:
self->args = args_create(1, "tiled");
break;
- case 'u':
- self->args = args_create(0);
- args_set(self->args, 'u', NULL);
- break;
- case 'U':
- self->args = args_create(0);
- args_set(self->args, 'U', NULL);
- break;
default:
self->args = args_create(0);
break;
@@ -110,21 +102,6 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_ctx *ctx)
if (args_has(self->args, 'p'))
previous = 1;
- layout_list_add(w);
- if (args_has(self->args, 'U')) {
- if ((layoutname = layout_list_redo(w)) == NULL) {
- ctx->info(ctx, "no more layout history");
- return (CMD_RETURN_ERROR);
- }
- goto set_layout;
- } else if (args_has(self->args, 'u')) {
- if ((layoutname = layout_list_undo(w)) == NULL) {
- ctx->info(ctx, "no more layout history");
- return (CMD_RETURN_ERROR);
- }
- goto set_layout;
- }
-
if (next || previous) {
if (next)
layout = layout_set_next(wl->window);
@@ -146,16 +123,14 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_ctx *ctx)
return (CMD_RETURN_NORMAL);
}
- if (args->argc == 0)
- return (CMD_RETURN_NORMAL);
- layoutname = args->argv[0];
-
-set_layout:
- if (layout_parse(wl->window, layoutname) == -1) {
- ctx->error(ctx, "can't set layout: %s", layoutname);
- return (CMD_RETURN_ERROR);
+ if (args->argc != 0) {
+ layoutname = args->argv[0];
+ if (layout_parse(wl->window, layoutname) == -1) {
+ ctx->error(ctx, "can't set layout: %s", layoutname);
+ return (CMD_RETURN_ERROR);
+ }
+ server_redraw_window(wl->window);
+ ctx->info(ctx, "arranging in: %s", layoutname);
}
- server_redraw_window(wl->window);
- ctx->info(ctx, "arranging in: %s", layoutname);
return (CMD_RETURN_NORMAL);
}