summaryrefslogtreecommitdiffstats
path: root/cmd-join-pane.c
diff options
context:
space:
mode:
authornicm <nicm>2019-04-17 14:37:48 +0000
committernicm <nicm>2019-04-17 14:37:48 +0000
commit78287e27c87ccdda1f8580382b336a0d02c26a03 (patch)
treee32c5b17141247149bbe79b26d5aa155f8fffcd2 /cmd-join-pane.c
parent835ccbac46c2c6c3a1e3192a1f1f5a5708ccbd48 (diff)
Break new window and pane creation common code from various commands and
window.c into a separate file spawn.c.
Diffstat (limited to 'cmd-join-pane.c')
-rw-r--r--cmd-join-pane.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd-join-pane.c b/cmd-join-pane.c
index 79bc1c9d..ab245302 100644
--- a/cmd-join-pane.c
+++ b/cmd-join-pane.c
@@ -72,7 +72,7 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
int size, percentage, dst_idx;
enum layout_type type;
struct layout_cell *lc;
- int not_same_window;
+ int not_same_window, flags;
if (self->entry == &cmd_join_pane_entry)
not_same_window = 1;
@@ -124,7 +124,11 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
else
size = (dst_wp->sx * percentage) / 100;
}
- lc = layout_split_pane(dst_wp, type, size, args_has(args, 'b'), 0);
+ if (args_has(args, 'b'))
+ flags = SPAWN_BEFORE;
+ else
+ flags = 0;
+ lc = layout_split_pane(dst_wp, type, size, flags);
if (lc == NULL) {
cmdq_error(item, "create pane failed: pane too small");
return (CMD_RETURN_ERROR);
@@ -145,7 +149,7 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
server_redraw_window(dst_w);
if (!args_has(args, 'd')) {
- window_set_active_pane(dst_w, src_wp);
+ window_set_active_pane(dst_w, src_wp, 1);
session_select(dst_s, dst_idx);
cmd_find_from_session(current, dst_s, 0);
server_redraw_session(dst_s);