diff --git a/CHANGES b/CHANGES index 64d4cb88..9fd37576 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ 14 January 2009 +* The alt-up and alt-down keys now resize a pane by five lines at a time. * switch-pane is now select-pane and requires -p to select a pane. The "o" key binding is changed to down-pane. * up-pane and down-pane commands, bound to arrow up and down by default. @@ -917,7 +918,7 @@ (including mutt, emacs). No status bar yet and no key remapping or other customisation. -$Id: CHANGES,v 1.205 2009-01-14 19:56:55 nicm Exp $ +$Id: CHANGES,v 1.206 2009-01-14 21:08:52 nicm Exp $ LocalWords: showw utf UTF fulvio ciriaco joshe OSC APC gettime abc DEF OA clr LocalWords: rivo nurges lscm Erdely eol smysession mysession ek dstname RB diff --git a/cmd-resize-pane-down.c b/cmd-resize-pane-down.c index 4f61db45..4707ab9e 100644 --- a/cmd-resize-pane-down.c +++ b/cmd-resize-pane-down.c @@ -1,4 +1,4 @@ -/* $Id: cmd-resize-pane-down.c,v 1.2 2009-01-14 19:29:32 nicm Exp $ */ +/* $Id: cmd-resize-pane-down.c,v 1.3 2009-01-14 21:08:52 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -26,13 +26,14 @@ * Decrease pane size. */ +void cmd_resize_pane_down_init(struct cmd *, int); void cmd_resize_pane_down_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_resize_pane_down_entry = { "resize-pane-down", "resizep-down", CMD_PANE_WINDOW_USAGE " [adjustment]", CMD_ZEROONEARG, - cmd_pane_init, + cmd_resize_pane_down_init, cmd_pane_parse, cmd_resize_pane_down_exec, cmd_pane_send, @@ -41,6 +42,18 @@ const struct cmd_entry cmd_resize_pane_down_entry = { cmd_pane_print }; +void +cmd_resize_pane_down_init(struct cmd *self, int key) +{ + struct cmd_pane_data *data; + + cmd_pane_init(self, key); + data = self->data; + + if (key == KEYC_ADDESC(KEYC_DOWN)) + data->arg = xstrdup("5"); +} + void cmd_resize_pane_down_exec(struct cmd *self, struct cmd_ctx *ctx) { diff --git a/cmd-resize-pane-up.c b/cmd-resize-pane-up.c index 82f8f8ec..8fd67f09 100644 --- a/cmd-resize-pane-up.c +++ b/cmd-resize-pane-up.c @@ -1,4 +1,4 @@ -/* $Id: cmd-resize-pane-up.c,v 1.2 2009-01-14 19:29:32 nicm Exp $ */ +/* $Id: cmd-resize-pane-up.c,v 1.3 2009-01-14 21:08:52 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -26,13 +26,14 @@ * Increase pane size. */ +void cmd_resize_pane_up_init(struct cmd *, int); void cmd_resize_pane_up_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_resize_pane_up_entry = { "resize-pane-up", "resizep-up", CMD_PANE_WINDOW_USAGE " [adjustment]", CMD_ZEROONEARG, - cmd_pane_init, + cmd_resize_pane_up_init, cmd_pane_parse, cmd_resize_pane_up_exec, cmd_pane_send, @@ -41,6 +42,18 @@ const struct cmd_entry cmd_resize_pane_up_entry = { cmd_pane_print }; +void +cmd_resize_pane_up_init(struct cmd *self, int key) +{ + struct cmd_pane_data *data; + + cmd_pane_init(self, key); + data = self->data; + + if (key == KEYC_ADDESC(KEYC_UP)) + data->arg = xstrdup("5"); +} + void cmd_resize_pane_up_exec(struct cmd *self, struct cmd_ctx *ctx) { diff --git a/key-bindings.c b/key-bindings.c index 04fa87e7..d7961bfe 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -1,4 +1,4 @@ -/* $Id: key-bindings.c,v 1.48 2009-01-14 19:56:55 nicm Exp $ */ +/* $Id: key-bindings.c,v 1.49 2009-01-14 21:08:52 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -111,6 +111,8 @@ key_bindings_init(void) { 'x', &cmd_kill_pane_entry, }, { KEYC_UP, &cmd_up_pane_entry }, { KEYC_DOWN, &cmd_down_pane_entry }, + { KEYC_ADDESC(KEYC_UP), &cmd_resize_pane_up_entry }, + { KEYC_ADDESC(KEYC_DOWN), &cmd_resize_pane_down_entry }, { KEYC_ADDCTL(KEYC_UP), &cmd_resize_pane_up_entry }, { KEYC_ADDCTL(KEYC_DOWN), &cmd_resize_pane_down_entry }, { META, &cmd_send_prefix_entry },