Add -b to splitw like joinw, from Felix Rosencrantz.

This commit is contained in:
nicm 2014-11-12 22:57:06 +00:00
parent f9308bc244
commit d37f266524
2 changed files with 9 additions and 4 deletions

View File

@ -37,8 +37,8 @@ enum cmd_retval cmd_split_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_split_window_entry = { const struct cmd_entry cmd_split_window_entry = {
"split-window", "splitw", "split-window", "splitw",
"c:dF:l:hp:Pt:v", 0, -1, "bc:dF:l:hp:Pt:v", 0, -1,
"[-dhvP] [-c start-directory] [-F format] [-p percentage|-l size] " "[-bdhvP] [-c start-directory] [-F format] [-p percentage|-l size] "
CMD_TARGET_PANE_USAGE " [command]", CMD_TARGET_PANE_USAGE " [command]",
0, 0,
cmd_split_window_exec cmd_split_window_exec
@ -145,7 +145,8 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
if (*shell == '\0' || areshell(shell)) if (*shell == '\0' || areshell(shell))
shell = _PATH_BSHELL; shell = _PATH_BSHELL;
if ((lc = layout_split_pane(wp, type, size, 0)) == NULL) { lc = layout_split_pane(wp, type, size, args_has(args, 'b'));
if (lc == NULL) {
cause = xstrdup("pane too small"); cause = xstrdup("pane too small");
goto error; goto error;
} }

6
tmux.1
View File

@ -1757,7 +1757,7 @@ is given and the selected window is already the current window,
the command behaves like the command behaves like
.Ic last-window . .Ic last-window .
.It Xo Ic split-window .It Xo Ic split-window
.Op Fl dhvP .Op Fl bdhvP
.Op Fl c Ar start-directory .Op Fl c Ar start-directory
.Oo Fl l .Oo Fl l
.Ar size | .Ar size |
@ -1781,6 +1781,10 @@ and
.Fl p .Fl p
options specify the size of the new pane in lines (for vertical split) or in options specify the size of the new pane in lines (for vertical split) or in
cells (for horizontal split), or as a percentage, respectively. cells (for horizontal split), or as a percentage, respectively.
The
.Fl b
option causes the new pane to be created to the left of or above
.Ar target-pane .
All other options have the same meaning as for the All other options have the same meaning as for the
.Ic new-window .Ic new-window
command. command.