summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-resize-pane.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2018-08-18 16:14:04 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2018-08-18 16:14:04 +0000
commit2041e72cd155f73e24ccbc92b7586ad67103fa93 (patch)
tree0a26b35897df6b785302317a35f176fa66033636 /usr.bin/tmux/cmd-resize-pane.c
parent8e2af373f80ddde4f6406c37bd4d0831ea76935b (diff)
Some tidying and helper functions.
Diffstat (limited to 'usr.bin/tmux/cmd-resize-pane.c')
-rw-r--r--usr.bin/tmux/cmd-resize-pane.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/usr.bin/tmux/cmd-resize-pane.c b/usr.bin/tmux/cmd-resize-pane.c
index 927b5bf444f..76d64c471c6 100644
--- a/usr.bin/tmux/cmd-resize-pane.c
+++ b/usr.bin/tmux/cmd-resize-pane.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-resize-pane.c,v 1.34 2018/06/24 21:24:09 nicm Exp $ */
+/* $OpenBSD: cmd-resize-pane.c,v 1.35 2018/08/18 16:14:03 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -91,9 +91,8 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
}
}
- if (args_has(self->args, 'x')) {
- x = args_strtonum(self->args, 'x', PANE_MINIMUM, INT_MAX,
- &cause);
+ if (args_has(args, 'x')) {
+ x = args_strtonum(args, 'x', PANE_MINIMUM, INT_MAX, &cause);
if (cause != NULL) {
cmdq_error(item, "width %s", cause);
free(cause);
@@ -101,9 +100,8 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
}
layout_resize_pane_to(wp, LAYOUT_LEFTRIGHT, x);
}
- if (args_has(self->args, 'y')) {
- y = args_strtonum(self->args, 'y', PANE_MINIMUM, INT_MAX,
- &cause);
+ if (args_has(args, 'y')) {
+ y = args_strtonum(args, 'y', PANE_MINIMUM, INT_MAX, &cause);
if (cause != NULL) {
cmdq_error(item, "height %s", cause);
free(cause);
@@ -112,13 +110,13 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
layout_resize_pane_to(wp, LAYOUT_TOPBOTTOM, y);
}
- if (args_has(self->args, 'L'))
+ if (args_has(args, 'L'))
layout_resize_pane(wp, LAYOUT_LEFTRIGHT, -adjust, 1);
- else if (args_has(self->args, 'R'))
+ else if (args_has(args, 'R'))
layout_resize_pane(wp, LAYOUT_LEFTRIGHT, adjust, 1);
- else if (args_has(self->args, 'U'))
+ else if (args_has(args, 'U'))
layout_resize_pane(wp, LAYOUT_TOPBOTTOM, -adjust, 1);
- else if (args_has(self->args, 'D'))
+ else if (args_has(args, 'D'))
layout_resize_pane(wp, LAYOUT_TOPBOTTOM, adjust, 1);
server_redraw_window(wl->window);