summaryrefslogtreecommitdiffstats
path: root/cmd-rotate-window.c
authorRaghavendra D Prabhu <[email protected]>2011-01-23 11:59:16 (GMT)
committer Raghavendra D Prabhu <[email protected]>2011-01-23 11:59:16 (GMT)
commit0426ab2b383afd38af7274759c3a8d017bc88f00 (patch) (side-by-side diff)
tree2cc4bf1da4062c9ef91f2e94a9625f2423f57102 /cmd-rotate-window.c
parent4e4aed43dc2b40b36f1b31cd3af9f874b78fa454 (diff)
parentb67bfd382d3401de572bb3487b1af3382a9cbeda (diff)
downloadtmux-old-master.zip
tmux-old-master.tar.gz
tmux-old-master.tar.bz2
merged new changesmaster
Diffstat (limited to 'cmd-rotate-window.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cmd-rotate-window.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/cmd-rotate-window.c b/cmd-rotate-window.c
index 44426e7..941e127 100644
--- a/cmd-rotate-window.c
+++ b/cmd-rotate-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-rotate-window.c,v 1.10 2009/11/14 17:56:39 tcunha Exp $ */
+/* $Id: cmd-rotate-window.c,v 1.11 2011/01/07 14:45:34 tcunha Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <[email protected]>
@@ -24,47 +24,42 @@
* Rotate the panes in a window.
*/
-void cmd_rotate_window_init(struct cmd *, int);
+void cmd_rotate_window_key_binding(struct cmd *, int);
int cmd_rotate_window_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_rotate_window_entry = {
"rotate-window", "rotatew",
+ "Dt:U", 0, 0,
"[-DU] " CMD_TARGET_WINDOW_USAGE,
- 0, "DU",
- cmd_rotate_window_init,
- cmd_target_parse,
- cmd_rotate_window_exec,
- cmd_target_free,
- cmd_target_print
+ 0,
+ cmd_rotate_window_key_binding,
+ NULL,
+ cmd_rotate_window_exec
};
void
-cmd_rotate_window_init(struct cmd *self, int key)
+cmd_rotate_window_key_binding(struct cmd *self, int key)
{
- struct cmd_target_data *data;
-
- cmd_target_init(self, key);
- data = self->data;
-
+ self->args = args_create(0);
if (key == ('o' | KEYC_ESCAPE))
- cmd_set_flag(&data->chflags, 'D');
+ args_set(self->args, 'D', NULL);
}
int
cmd_rotate_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
- struct cmd_target_data *data = self->data;
+ struct args *args = self->args;
struct winlink *wl;
struct window *w;
struct window_pane *wp, *wp2;
struct layout_cell *lc;
u_int sx, sy, xoff, yoff;
- if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
+ if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL)
return (-1);
w = wl->window;
- if (cmd_check_flag(data->chflags, 'D')) {
+ if (args_has(self->args, 'D')) {
wp = TAILQ_LAST(&w->panes, window_panes);
TAILQ_REMOVE(&w->panes, wp, entry);
TAILQ_INSERT_HEAD(&w->panes, wp, entry);