Add -f for full size to join-pane (like split-window), from Theo Buehler.

This commit is contained in:
nicm 2019-11-18 09:43:31 +00:00
parent 4bc445f080
commit 350a434939
2 changed files with 9 additions and 6 deletions

View File

@ -36,8 +36,8 @@ const struct cmd_entry cmd_join_pane_entry = {
.name = "join-pane", .name = "join-pane",
.alias = "joinp", .alias = "joinp",
.args = { "bdhvp:l:s:t:", 0, 0 }, .args = { "bdfhvp:l:s:t:", 0, 0 },
.usage = "[-bdhv] [-l size] " CMD_SRCDST_PANE_USAGE, .usage = "[-bdfhv] [-l size] " CMD_SRCDST_PANE_USAGE,
.source = { 's', CMD_FIND_PANE, CMD_FIND_DEFAULT_MARKED }, .source = { 's', CMD_FIND_PANE, CMD_FIND_DEFAULT_MARKED },
.target = { 't', CMD_FIND_PANE, 0 }, .target = { 't', CMD_FIND_PANE, 0 },
@ -143,10 +143,13 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
else else
size = (dst_wp->sx * percentage) / 100; size = (dst_wp->sx * percentage) / 100;
} }
flags = 0;
if (args_has(args, 'b')) if (args_has(args, 'b'))
flags = SPAWN_BEFORE; flags |= SPAWN_BEFORE;
else if (args_has(args, 'f'))
flags = 0; flags |= SPAWN_FULLSIZE;
lc = layout_split_pane(dst_wp, type, size, flags); lc = layout_split_pane(dst_wp, type, size, flags);
if (lc == NULL) { if (lc == NULL) {
cmdq_error(item, "create pane failed: pane too small"); cmdq_error(item, "create pane failed: pane too small");

2
tmux.1
View File

@ -1890,7 +1890,7 @@ zooms the pane.
.Pp .Pp
This command works only if at least one client is attached. This command works only if at least one client is attached.
.It Xo Ic join-pane .It Xo Ic join-pane
.Op Fl bdhv .Op Fl bdfhv
.Op Fl l Ar size .Op Fl l Ar size
.Op Fl s Ar src-pane .Op Fl s Ar src-pane
.Op Fl t Ar dst-pane .Op Fl t Ar dst-pane