diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-11-22 00:12:33 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-11-22 00:12:33 +0000 |
commit | 1527ed0ff8ca9da9d297a644ca23bda87b9ffdac (patch) | |
tree | 884b0b2f256df8226698e283cd6016680a772610 /cmd-split-window.c | |
parent | bce5aedc647a6f35aa36481d4adf219cebde8a16 (diff) | |
download | rtmux-1527ed0ff8ca9da9d297a644ca23bda87b9ffdac.tar.gz rtmux-1527ed0ff8ca9da9d297a644ca23bda87b9ffdac.tar.bz2 rtmux-1527ed0ff8ca9da9d297a644ca23bda87b9ffdac.zip |
Sync OpenBSD patchset 558:
When -h and -p are given to split-window, calculate the percentage size using
the width instead of the height.
Diffstat (limited to 'cmd-split-window.c')
-rw-r--r-- | cmd-split-window.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/cmd-split-window.c b/cmd-split-window.c index 1938990f..c21160fe 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-split-window.c,v 1.29 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-split-window.c,v 1.30 2009-11-22 00:12:33 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -173,17 +173,21 @@ cmd_split_window_exec(struct cmd *self, struct cmd_ctx *ctx) else cwd = ctx->cmdclient->cwd; + type = LAYOUT_TOPBOTTOM; + if (data->flag_horizontal) + type = LAYOUT_LEFTRIGHT; + size = -1; if (data->size != -1) size = data->size; - else if (data->percentage != -1) - size = (w->active->sy * data->percentage) / 100; + else if (data->percentage != -1) { + if (type == LAYOUT_TOPBOTTOM) + size = (w->active->sy * data->percentage) / 100; + else + size = (w->active->sx * data->percentage) / 100; + } hlimit = options_get_number(&s->options, "history-limit"); - type = LAYOUT_TOPBOTTOM; - if (data->flag_horizontal) - type = LAYOUT_LEFTRIGHT; - shell = options_get_string(&s->options, "default-shell"); if (*shell == '\0' || areshell(shell)) shell = _PATH_BSHELL; |