mirror of
https://github.com/tmux/tmux.git
synced 2024-11-17 18:08:51 +00:00
UPPER -> BIG, sort, and bump protocol version.
This commit is contained in:
parent
a8ec5f1d09
commit
6c442c19ba
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-generic.c,v 1.26 2009-05-04 17:58:26 nicm Exp $ */
|
/* $Id: cmd-generic.c,v 1.27 2009-05-21 19:46:00 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -24,8 +24,8 @@
|
|||||||
#include "tmux.h"
|
#include "tmux.h"
|
||||||
|
|
||||||
#define CMD_FLAGS "adDgkuU"
|
#define CMD_FLAGS "adDgkuU"
|
||||||
#define CMD_FLAGMASK (CMD_AFLAG|CMD_DFLAG|CMD_UPPERDFLAG|CMD_GFLAG|CMD_KFLAG| \
|
#define CMD_FLAGMASK (CMD_AFLAG|CMD_DFLAG|CMD_BIGDFLAG|CMD_GFLAG|CMD_KFLAG| \
|
||||||
CMD_UFLAG|CMD_UPPERUFLAG)
|
CMD_UFLAG|CMD_BIGUFLAG)
|
||||||
|
|
||||||
int cmd_do_flags(int, int, int *);
|
int cmd_do_flags(int, int, int *);
|
||||||
size_t cmd_print_flags(char *, size_t, size_t, int);
|
size_t cmd_print_flags(char *, size_t, size_t, int);
|
||||||
@ -56,8 +56,8 @@ cmd_do_flags(int opt, int iflags, int *oflags)
|
|||||||
}
|
}
|
||||||
return (-1);
|
return (-1);
|
||||||
case 'D':
|
case 'D':
|
||||||
if (iflags & CMD_UPPERDFLAG) {
|
if (iflags & CMD_BIGDFLAG) {
|
||||||
(*oflags) |= CMD_UPPERDFLAG;
|
(*oflags) |= CMD_BIGDFLAG;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -80,8 +80,8 @@ cmd_do_flags(int opt, int iflags, int *oflags)
|
|||||||
}
|
}
|
||||||
return (-1);
|
return (-1);
|
||||||
case 'U':
|
case 'U':
|
||||||
if (iflags & CMD_UPPERUFLAG) {
|
if (iflags & CMD_BIGUFLAG) {
|
||||||
(*oflags) |= CMD_UPPERUFLAG;
|
(*oflags) |= CMD_BIGUFLAG;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -99,7 +99,7 @@ cmd_print_flags(char *buf, size_t len, size_t off, int flags)
|
|||||||
off += xsnprintf(buf + off, len - off, " -");
|
off += xsnprintf(buf + off, len - off, " -");
|
||||||
if (off < len && flags & CMD_AFLAG)
|
if (off < len && flags & CMD_AFLAG)
|
||||||
off += xsnprintf(buf + off, len - off, "a");
|
off += xsnprintf(buf + off, len - off, "a");
|
||||||
if (off < len && flags & CMD_UPPERDFLAG)
|
if (off < len && flags & CMD_BIGDFLAG)
|
||||||
off += xsnprintf(buf + off, len - off, "D");
|
off += xsnprintf(buf + off, len - off, "D");
|
||||||
if (off < len && flags & CMD_DFLAG)
|
if (off < len && flags & CMD_DFLAG)
|
||||||
off += xsnprintf(buf + off, len - off, "d");
|
off += xsnprintf(buf + off, len - off, "d");
|
||||||
@ -109,7 +109,7 @@ cmd_print_flags(char *buf, size_t len, size_t off, int flags)
|
|||||||
off += xsnprintf(buf + off, len - off, "k");
|
off += xsnprintf(buf + off, len - off, "k");
|
||||||
if (off < len && flags & CMD_UFLAG)
|
if (off < len && flags & CMD_UFLAG)
|
||||||
off += xsnprintf(buf + off, len - off, "u");
|
off += xsnprintf(buf + off, len - off, "u");
|
||||||
if (off < len && flags & CMD_UPPERUFLAG)
|
if (off < len && flags & CMD_BIGUFLAG)
|
||||||
off += xsnprintf(buf + off, len - off, "U");
|
off += xsnprintf(buf + off, len - off, "U");
|
||||||
return (off - boff);
|
return (off - boff);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-resize-pane.c,v 1.6 2009-05-18 21:16:09 nicm Exp $ */
|
/* $Id: cmd-resize-pane.c,v 1.7 2009-05-21 19:46:00 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -32,7 +32,7 @@ int cmd_resize_pane_exec(struct cmd *, struct cmd_ctx *);
|
|||||||
const struct cmd_entry cmd_resize_pane_entry = {
|
const struct cmd_entry cmd_resize_pane_entry = {
|
||||||
"resize-pane", "resizep",
|
"resize-pane", "resizep",
|
||||||
CMD_PANE_WINDOW_USAGE "[-DU] [adjustment]",
|
CMD_PANE_WINDOW_USAGE "[-DU] [adjustment]",
|
||||||
CMD_ARG01|CMD_UPPERUFLAG|CMD_UPPERDFLAG,
|
CMD_ARG01|CMD_BIGUFLAG|CMD_BIGDFLAG,
|
||||||
cmd_resize_pane_init,
|
cmd_resize_pane_init,
|
||||||
cmd_pane_parse,
|
cmd_pane_parse,
|
||||||
cmd_resize_pane_exec,
|
cmd_resize_pane_exec,
|
||||||
@ -51,12 +51,12 @@ cmd_resize_pane_init(struct cmd *self, int key)
|
|||||||
data = self->data;
|
data = self->data;
|
||||||
|
|
||||||
if (key == KEYC_ADDCTL(KEYC_DOWN))
|
if (key == KEYC_ADDCTL(KEYC_DOWN))
|
||||||
data->flags |= CMD_UPPERDFLAG;
|
data->flags |= CMD_BIGDFLAG;
|
||||||
|
|
||||||
if (key == KEYC_ADDESC(KEYC_UP))
|
if (key == KEYC_ADDESC(KEYC_UP))
|
||||||
data->arg = xstrdup("5");
|
data->arg = xstrdup("5");
|
||||||
if (key == KEYC_ADDESC(KEYC_DOWN)) {
|
if (key == KEYC_ADDESC(KEYC_DOWN)) {
|
||||||
data->flags |= CMD_UPPERDFLAG;
|
data->flags |= CMD_BIGDFLAG;
|
||||||
data->arg = xstrdup("5");
|
data->arg = xstrdup("5");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ cmd_resize_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(data->flags & CMD_UPPERDFLAG))
|
if (!(data->flags & CMD_BIGDFLAG))
|
||||||
adjust = -adjust;
|
adjust = -adjust;
|
||||||
if (layout_resize(wp, adjust) != 0) {
|
if (layout_resize(wp, adjust) != 0) {
|
||||||
ctx->error(ctx, "layout %s "
|
ctx->error(ctx, "layout %s "
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-rotate-window.c,v 1.2 2009-04-21 20:06:46 nicm Exp $ */
|
/* $Id: cmd-rotate-window.c,v 1.3 2009-05-21 19:46:00 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -30,7 +30,7 @@ int cmd_rotate_window_exec(struct cmd *, struct cmd_ctx *);
|
|||||||
const struct cmd_entry cmd_rotate_window_entry = {
|
const struct cmd_entry cmd_rotate_window_entry = {
|
||||||
"rotate-window", "rotatew",
|
"rotate-window", "rotatew",
|
||||||
"[-DU] " CMD_TARGET_WINDOW_USAGE,
|
"[-DU] " CMD_TARGET_WINDOW_USAGE,
|
||||||
CMD_UPPERUFLAG|CMD_UPPERDFLAG,
|
CMD_BIGUFLAG|CMD_BIGDFLAG,
|
||||||
cmd_rotate_window_init,
|
cmd_rotate_window_init,
|
||||||
cmd_target_parse,
|
cmd_target_parse,
|
||||||
cmd_rotate_window_exec,
|
cmd_rotate_window_exec,
|
||||||
@ -49,7 +49,7 @@ cmd_rotate_window_init(struct cmd *self, int key)
|
|||||||
data = self->data;
|
data = self->data;
|
||||||
|
|
||||||
if (key == KEYC_ADDESC('o'))
|
if (key == KEYC_ADDESC('o'))
|
||||||
data->flags |= CMD_UPPERDFLAG;
|
data->flags |= CMD_BIGDFLAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -65,7 +65,7 @@ cmd_rotate_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
return (-1);
|
return (-1);
|
||||||
w = wl->window;
|
w = wl->window;
|
||||||
|
|
||||||
if (data->flags & CMD_UPPERDFLAG) {
|
if (data->flags & CMD_BIGDFLAG) {
|
||||||
wp = TAILQ_LAST(&w->panes, window_panes);
|
wp = TAILQ_LAST(&w->panes, window_panes);
|
||||||
TAILQ_REMOVE(&w->panes, wp, entry);
|
TAILQ_REMOVE(&w->panes, wp, entry);
|
||||||
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
|
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
|
||||||
|
14
tmux.h
14
tmux.h
@ -1,4 +1,4 @@
|
|||||||
/* $Id: tmux.h,v 1.325 2009-05-19 16:08:35 nicm Exp $ */
|
/* $Id: tmux.h,v 1.326 2009-05-21 19:46:00 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define PROTOCOL_VERSION -12
|
#define PROTOCOL_VERSION -13
|
||||||
|
|
||||||
/* Shut up gcc warnings about empty if bodies. */
|
/* Shut up gcc warnings about empty if bodies. */
|
||||||
#define RB_AUGMENT(x) do {} while (0)
|
#define RB_AUGMENT(x) do {} while (0)
|
||||||
@ -917,13 +917,13 @@ struct cmd_entry {
|
|||||||
#define CMD_CANTNEST 0x2
|
#define CMD_CANTNEST 0x2
|
||||||
#define CMD_ARG1 0x4
|
#define CMD_ARG1 0x4
|
||||||
#define CMD_ARG01 0x8
|
#define CMD_ARG01 0x8
|
||||||
#define CMD_KFLAG 0x10
|
#define CMD_AFLAG 0x10
|
||||||
#define CMD_DFLAG 0x20
|
#define CMD_DFLAG 0x20
|
||||||
#define CMD_GFLAG 0x40
|
#define CMD_GFLAG 0x40
|
||||||
#define CMD_UFLAG 0x80
|
#define CMD_KFLAG 0x80
|
||||||
#define CMD_AFLAG 0x100
|
#define CMD_UFLAG 0x100
|
||||||
#define CMD_UPPERUFLAG 0x200
|
#define CMD_BIGDFLAG 0x200
|
||||||
#define CMD_UPPERDFLAG 0x400
|
#define CMD_BIGUFLAG 0x400
|
||||||
|
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user