Alt-up/down to resize by five lines.

This commit is contained in:
Nicholas Marriott 2009-01-14 21:08:52 +00:00
parent e9bb939884
commit 0a99ba0b30
4 changed files with 35 additions and 6 deletions

View File

@ -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

View File

@ -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 <nicm@users.sourceforge.net>
@ -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)
{

View File

@ -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 <nicm@users.sourceforge.net>
@ -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)
{

View File

@ -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 <nicm@users.sourceforge.net>
@ -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 },