diff options
author | Thomas Adam <thomas@xteddy.org> | 2022-03-09 00:01:12 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2022-03-09 00:01:12 +0000 |
commit | ee3f1d25d568a425420cf14ccba6a1b2a012f7dd (patch) | |
tree | 447b4dbe3aeb74d63a5f97dd54e0958d96627943 /cmd-split-window.c | |
parent | 25337ac102b42b0cb44eb5708367345f3a8a5312 (diff) | |
parent | bfbe972225d10be7f6eaca22d88d90df4fae09c9 (diff) | |
download | rtmux-ee3f1d25d568a425420cf14ccba6a1b2a012f7dd.tar.gz rtmux-ee3f1d25d568a425420cf14ccba6a1b2a012f7dd.tar.bz2 rtmux-ee3f1d25d568a425420cf14ccba6a1b2a012f7dd.zip |
Merge branch 'obsd-master' into master
Diffstat (limited to 'cmd-split-window.c')
-rw-r--r-- | cmd-split-window.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/cmd-split-window.c b/cmd-split-window.c index 888d4106..9947dfd3 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -60,6 +60,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item) struct client *tc = cmdq_get_target_client(item); struct session *s = target->s; struct winlink *wl = target->wl; + struct window *w = wl->window; struct window_pane *wp = target->wp, *new_wp; enum layout_type type; struct layout_cell *lc; @@ -86,10 +87,17 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item) cmdq_error(item, "percentage %s", errstr); return (CMD_RETURN_ERROR); } - if (type == LAYOUT_TOPBOTTOM) - size = (wp->sy * percentage) / 100; - else - size = (wp->sx * percentage) / 100; + if (args_has(args, 'f')) { + if (type == LAYOUT_TOPBOTTOM) + size = (w->sy * percentage) / 100; + else + size = (w->sx * percentage) / 100; + } else { + if (type == LAYOUT_TOPBOTTOM) + size = (wp->sy * percentage) / 100; + else + size = (wp->sx * percentage) / 100; + } } else { size = args_strtonum(args, 'l', 0, INT_MAX, &cause); if (cause != NULL) { @@ -105,10 +113,17 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item) free(cause); return (CMD_RETURN_ERROR); } - if (type == LAYOUT_TOPBOTTOM) - size = (wp->sy * percentage) / 100; - else - size = (wp->sx * percentage) / 100; + if (args_has(args, 'f')) { + if (type == LAYOUT_TOPBOTTOM) + size = (w->sy * percentage) / 100; + else + size = (w->sx * percentage) / 100; + } else { + if (type == LAYOUT_TOPBOTTOM) + size = (wp->sy * percentage) / 100; + else + size = (wp->sx * percentage) / 100; + } } else size = -1; |