diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2019-04-07 13:01:03 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2019-04-07 13:01:03 +0100 |
commit | 5ece386cdf84b692c1f28b5bf018ac619d067fde (patch) | |
tree | 29e38521bfa457820300718c394b8b72d584e400 /cmd-join-pane.c | |
parent | 7653328ce7e2876dff3219a02cdd87ade3caf90a (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.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd-join-pane.c b/cmd-join-pane.c index 947b2499..3d798e09 100644 --- a/cmd-join-pane.c +++ b/cmd-join-pane.c @@ -71,7 +71,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; @@ -123,7 +123,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); @@ -144,7 +148,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); |