version 1.13, 2013/03/22 10:37:39 |
version 1.14, 2013/03/24 09:54:10 |
|
|
*/ |
*/ |
|
|
void cmd_resize_pane_key_binding(struct cmd *, int); |
void cmd_resize_pane_key_binding(struct cmd *, int); |
enum cmd_retval cmd_resize_pane_exec(struct cmd *, struct cmd_ctx *); |
enum cmd_retval cmd_resize_pane_exec(struct cmd *, struct cmd_q *); |
|
|
const struct cmd_entry cmd_resize_pane_entry = { |
const struct cmd_entry cmd_resize_pane_entry = { |
"resize-pane", "resizep", |
"resize-pane", "resizep", |
|
|
} |
} |
|
|
enum cmd_retval |
enum cmd_retval |
cmd_resize_pane_exec(struct cmd *self, struct cmd_ctx *ctx) |
cmd_resize_pane_exec(struct cmd *self, struct cmd_q *cmdq) |
{ |
{ |
struct args *args = self->args; |
struct args *args = self->args; |
struct winlink *wl; |
struct winlink *wl; |
|
|
u_int adjust; |
u_int adjust; |
int x, y; |
int x, y; |
|
|
if ((wl = cmd_find_pane(ctx, args_get(args, 't'), NULL, &wp)) == NULL) |
if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), NULL, &wp)) == NULL) |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
|
|
if (args->argc == 0) |
if (args->argc == 0) |
|
|
else { |
else { |
adjust = strtonum(args->argv[0], 1, INT_MAX, &errstr); |
adjust = strtonum(args->argv[0], 1, INT_MAX, &errstr); |
if (errstr != NULL) { |
if (errstr != NULL) { |
ctx->error(ctx, "adjustment %s", errstr); |
cmdq_error(cmdq, "adjustment %s", errstr); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |
} |
} |
|
|
x = args_strtonum(self->args, 'x', PANE_MINIMUM, INT_MAX, |
x = args_strtonum(self->args, 'x', PANE_MINIMUM, INT_MAX, |
&cause); |
&cause); |
if (cause != NULL) { |
if (cause != NULL) { |
ctx->error(ctx, "width %s", cause); |
cmdq_error(cmdq, "width %s", cause); |
free(cause); |
free(cause); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |
|
|
y = args_strtonum(self->args, 'y', PANE_MINIMUM, INT_MAX, |
y = args_strtonum(self->args, 'y', PANE_MINIMUM, INT_MAX, |
&cause); |
&cause); |
if (cause != NULL) { |
if (cause != NULL) { |
ctx->error(ctx, "height %s", cause); |
cmdq_error(cmdq, "height %s", cause); |
free(cause); |
free(cause); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |