diff options
author | nicm <nicm> | 2015-06-04 11:43:51 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-06-04 11:43:51 +0000 |
commit | a863834574ec02b87ff0e7245ef31f0d4543ab34 (patch) | |
tree | 4fe2aa4fe98c34bb0d56e5032460889b70dfc317 /cmd-swap-pane.c | |
parent | a3edfd9e84f4f8e9b74425cdc4b00fe9cb3d0ba6 (diff) |
Add support for a single "marked pane". There is one marked pane in the
server at a time; it may be toggled or cleared with select-pane -m and
-M (the border is highlighted). A new target '~' or '{marked}' specifies
the marked pane to commands and it is the default target for the
swap-pane and join-pane -s flag (this makes them much simpler to use -
mark the source pane and then change to the target pane to run swapp or
joinp).
Diffstat (limited to 'cmd-swap-pane.c')
-rw-r--r-- | cmd-swap-pane.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd-swap-pane.c b/cmd-swap-pane.c index 918a2e4f..c4751c36 100644 --- a/cmd-swap-pane.c +++ b/cmd-swap-pane.c @@ -58,18 +58,22 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_q *cmdq) src_wp = TAILQ_NEXT(dst_wp, entry); if (src_wp == NULL) src_wp = TAILQ_FIRST(&dst_w->panes); + src_wl = dst_wl; } else if (args_has(self->args, 'U')) { src_wp = TAILQ_PREV(dst_wp, window_panes, entry); if (src_wp == NULL) src_wp = TAILQ_LAST(&dst_w->panes, window_panes); + src_wl = dst_wl; } else { - src_wl = cmd_find_pane(cmdq, NULL, NULL, &src_wp); + src_wl = cmd_find_pane_marked(cmdq, NULL, NULL, + &src_wp); if (src_wl == NULL) return (CMD_RETURN_ERROR); src_w = src_wl->window; } } else { - src_wl = cmd_find_pane(cmdq, args_get(args, 's'), NULL, &src_wp); + src_wl = cmd_find_pane_marked(cmdq, args_get(args, 's'), NULL, + &src_wp); if (src_wl == NULL) return (CMD_RETURN_ERROR); src_w = src_wl->window; |