From e33ba57c13139bc9ae6e92be169de6dc322e38eb Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 17 Jan 2013 00:11:22 +0000 Subject: Remove the layout undo/redo code which never really worked. --- cmd-select-layout.c | 45 ++++++++++----------------------------------- 1 file changed, 10 insertions(+), 35 deletions(-) (limited to 'cmd-select-layout.c') 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); } -- cgit