summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-select-pane.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-09-14 11:34:50 +0000
committernicm <nicm@openbsd.org>2015-09-14 11:34:50 +0000
commit18c28068a39f5b6bb50e35e49d7e5ed5790f9708 (patch)
tree9e56c6a6b3a45be99042c5cc98bc728869576554 /usr.bin/tmux/cmd-select-pane.c
parentFix more ifmedia64 fallout in the kernel. It's hiding everywhere... (diff)
downloadwireguard-openbsd-18c28068a39f5b6bb50e35e49d7e5ed5790f9708.tar.xz
wireguard-openbsd-18c28068a39f5b6bb50e35e49d7e5ed5790f9708.zip
When the active pane changes, redraw panes if the style has
changed. From Cam Hutchison.
Diffstat (limited to 'usr.bin/tmux/cmd-select-pane.c')
-rw-r--r--usr.bin/tmux/cmd-select-pane.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/usr.bin/tmux/cmd-select-pane.c b/usr.bin/tmux/cmd-select-pane.c
index 248e5ace8e4..dcc7deba049 100644
--- a/usr.bin/tmux/cmd-select-pane.c
+++ b/usr.bin/tmux/cmd-select-pane.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-select-pane.c,v 1.24 2015/06/04 11:43:51 nicm Exp $ */
+/* $OpenBSD: cmd-select-pane.c,v 1.25 2015/09/14 11:34:50 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -47,6 +47,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
struct winlink *wl;
+ struct window *w;
struct session *s;
struct window_pane *wp, *lastwp, *markedwp;
const char *style;
@@ -55,21 +56,24 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq)
wl = cmd_find_window(cmdq, args_get(args, 't'), NULL);
if (wl == NULL)
return (CMD_RETURN_ERROR);
+ w = wl->window;
- if (wl->window->last == NULL) {
+ if (w->last == NULL) {
cmdq_error(cmdq, "no last pane");
return (CMD_RETURN_ERROR);
}
if (args_has(self->args, 'e'))
- wl->window->last->flags &= ~PANE_INPUTOFF;
+ w->last->flags &= ~PANE_INPUTOFF;
else if (args_has(self->args, 'd'))
- wl->window->last->flags |= PANE_INPUTOFF;
+ w->last->flags |= PANE_INPUTOFF;
else {
- 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);
+ server_unzoom_window(w);
+ window_redraw_active_switch(w, w->last);
+ if (window_set_active_pane(w, w->last)) {
+ server_status_window(w);
+ server_redraw_window_borders(w);
+ }
}
return (CMD_RETURN_NORMAL);
@@ -77,6 +81,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq)
if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp)) == NULL)
return (CMD_RETURN_ERROR);
+ w = wl->window;
if (args_has(args, 'm') || args_has(args, 'M')) {
if (args_has(args, 'm') && !window_pane_visible(wp))
@@ -135,16 +140,17 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_NORMAL);
}
- if (wp == wl->window->active)
+ if (wp == w->active)
return (CMD_RETURN_NORMAL);
server_unzoom_window(wp->window);
if (!window_pane_visible(wp)) {
cmdq_error(cmdq, "pane not visible");
return (CMD_RETURN_ERROR);
}
- if (window_set_active_pane(wl->window, wp)) {
- server_status_window(wl->window);
- server_redraw_window_borders(wl->window);
+ window_redraw_active_switch(w, wp);
+ if (window_set_active_pane(w, wp)) {
+ server_status_window(w);
+ server_redraw_window_borders(w);
}
return (CMD_RETURN_NORMAL);