version 1.58, 2020/05/26 09:01:03 |
version 1.59, 2020/06/13 09:05:53 |
|
|
.name = "break-pane", |
.name = "break-pane", |
.alias = "breakp", |
.alias = "breakp", |
|
|
.args = { "adPF:n:s:t:", 0, 0 }, |
.args = { "abdPF:n:s:t:", 0, 0 }, |
.usage = "[-adP] [-F format] [-n window-name] [-s src-pane] " |
.usage = "[-abdP] [-F format] [-n window-name] [-s src-pane] " |
"[-t dst-window]", |
"[-t dst-window]", |
|
|
.source = { 's', CMD_FIND_PANE, 0 }, |
.source = { 's', CMD_FIND_PANE, 0 }, |
|
|
struct session *dst_s = target->s; |
struct session *dst_s = target->s; |
struct window_pane *wp = source->wp; |
struct window_pane *wp = source->wp; |
struct window *w = wl->window; |
struct window *w = wl->window; |
char *name, *cause; |
char *name, *cause, *cp; |
int idx = target->idx; |
int idx = target->idx, before; |
const char *template; |
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) |
if (target->wl != NULL) |
idx = winlink_shuffle_up(dst_s, target->wl); |
idx = winlink_shuffle_up(dst_s, target->wl, before); |
else |
else |
idx = winlink_shuffle_up(dst_s, dst_s->curw); |
idx = winlink_shuffle_up(dst_s, dst_s->curw, before); |
if (idx == -1) |
if (idx == -1) |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |