diff options
author | nicm <nicm> | 2020-06-13 09:05:53 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-06-13 09:05:53 +0000 |
commit | 1c78155e70a9f72ed6c191807c2b381cf114b91f (patch) | |
tree | d1cf209a0268843216fe440b83a68467045ee244 /cmd-break-pane.c | |
parent | d52ac7d027e40b34e7089addc4f905d03d9c1b16 (diff) | |
download | rtmux-1c78155e70a9f72ed6c191807c2b381cf114b91f.tar.gz rtmux-1c78155e70a9f72ed6c191807c2b381cf114b91f.tar.bz2 rtmux-1c78155e70a9f72ed6c191807c2b381cf114b91f.zip |
Add -b flags to insert a window before (like the existing -a for after)
to break-pane, move-window, new-window. GitHub issue 2261.
Diffstat (limited to 'cmd-break-pane.c')
-rw-r--r-- | cmd-break-pane.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd-break-pane.c b/cmd-break-pane.c index 6d5041e8..4c436405 100644 --- a/cmd-break-pane.c +++ b/cmd-break-pane.c @@ -34,8 +34,8 @@ const struct cmd_entry cmd_break_pane_entry = { .name = "break-pane", .alias = "breakp", - .args = { "adPF:n:s:t:", 0, 0 }, - .usage = "[-adP] [-F format] [-n window-name] [-s src-pane] " + .args = { "abdPF:n:s:t:", 0, 0 }, + .usage = "[-abdP] [-F format] [-n window-name] [-s src-pane] " "[-t dst-window]", .source = { 's', CMD_FIND_PANE, 0 }, @@ -58,16 +58,16 @@ cmd_break_pane_exec(struct cmd *self, struct cmdq_item *item) struct session *dst_s = target->s; struct window_pane *wp = source->wp; struct window *w = wl->window; - char *name, *cause; - int idx = target->idx; + char *name, *cause, *cp; + int idx = target->idx, before; const char *template; - char *cp; - if (args_has(args, 'a')) { + before = args_has(args, 'b'); + if (args_has(args, 'a') || before) { if (target->wl != NULL) - idx = winlink_shuffle_up(dst_s, target->wl); + idx = winlink_shuffle_up(dst_s, target->wl, before); else - idx = winlink_shuffle_up(dst_s, dst_s->curw); + idx = winlink_shuffle_up(dst_s, dst_s->curw, before); if (idx == -1) return (CMD_RETURN_ERROR); } |