From 1c78155e70a9f72ed6c191807c2b381cf114b91f Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 13 Jun 2020 09:05:53 +0000 Subject: Add -b flags to insert a window before (like the existing -a for after) to break-pane, move-window, new-window. GitHub issue 2261. --- cmd-break-pane.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cmd-break-pane.c') 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); } -- cgit