aboutsummaryrefslogtreecommitdiff
path: root/cmd-select-pane.c
diff options
context:
space:
mode:
authorThomas Adam <thomas.adam@smoothwall.net>2013-03-25 14:59:29 +0000
committerThomas Adam <thomas.adam@smoothwall.net>2013-03-25 14:59:29 +0000
commitf90eb43fcb12720711ea01b110c5b474111e6600 (patch)
tree43b2e85bcf1626e3810ade10578ac18399931772 /cmd-select-pane.c
parent418ba99078a2712ece398e17a5a9bc1f6600126b (diff)
parent58bb6f8c5650d496fb3b872766c0278aa024631d (diff)
downloadrtmux-f90eb43fcb12720711ea01b110c5b474111e6600.tar.gz
rtmux-f90eb43fcb12720711ea01b110c5b474111e6600.tar.bz2
rtmux-f90eb43fcb12720711ea01b110c5b474111e6600.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-select-pane.c')
-rw-r--r--cmd-select-pane.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/cmd-select-pane.c b/cmd-select-pane.c
index 8ebae5fb..b8a12671 100644
--- a/cmd-select-pane.c
+++ b/cmd-select-pane.c
@@ -25,7 +25,7 @@
*/
void cmd_select_pane_key_binding(struct cmd *, int);
-enum cmd_retval cmd_select_pane_exec(struct cmd *, struct cmd_ctx *);
+enum cmd_retval cmd_select_pane_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_select_pane_entry = {
"select-pane", "selectp",
@@ -64,22 +64,23 @@ cmd_select_pane_key_binding(struct cmd *self, int key)
}
enum cmd_retval
-cmd_select_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
+cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
struct winlink *wl;
struct window_pane *wp;
if (self->entry == &cmd_last_pane_entry || args_has(args, 'l')) {
- wl = cmd_find_window(ctx, args_get(args, 't'), NULL);
+ wl = cmd_find_window(cmdq, args_get(args, 't'), NULL);
if (wl == NULL)
return (CMD_RETURN_ERROR);
if (wl->window->last == NULL) {
- ctx->error(ctx, "no last pane");
+ cmdq_error(cmdq, "no last pane");
return (CMD_RETURN_ERROR);
}
+ server_unzoom_window(wl->window);
window_set_active_pane(wl->window, wl->window->last);
server_status_window(wl->window);
server_redraw_window_borders(wl->window);
@@ -87,11 +88,12 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
return (CMD_RETURN_NORMAL);
}
- if ((wl = cmd_find_pane(ctx, args_get(args, 't'), NULL, &wp)) == NULL)
+ if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), NULL, &wp)) == NULL)
return (CMD_RETURN_ERROR);
+ server_unzoom_window(wp->window);
if (!window_pane_visible(wp)) {
- ctx->error(ctx, "pane not visible");
+ cmdq_error(cmdq, "pane not visible");
return (CMD_RETURN_ERROR);
}
@@ -104,7 +106,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
else if (args_has(self->args, 'D'))
wp = window_pane_find_down(wp);
if (wp == NULL) {
- ctx->error(ctx, "pane not found");
+ cmdq_error(cmdq, "pane not found");
return (CMD_RETURN_ERROR);
}