=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-select-pane.c,v retrieving revision 1.24 retrieving revision 1.25 diff -c -r1.24 -r1.25 *** src/usr.bin/tmux/cmd-select-pane.c 2015/06/04 11:43:51 1.24 --- src/usr.bin/tmux/cmd-select-pane.c 2015/09/14 11:34:50 1.25 *************** *** 1,4 **** ! /* $OpenBSD: cmd-select-pane.c,v 1.24 2015/06/04 11:43:51 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-select-pane.c,v 1.25 2015/09/14 11:34:50 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 47,52 **** --- 47,53 ---- { struct args *args = self->args; struct winlink *wl; + struct window *w; struct session *s; struct window_pane *wp, *lastwp, *markedwp; const char *style; *************** *** 55,75 **** wl = cmd_find_window(cmdq, args_get(args, 't'), NULL); if (wl == NULL) return (CMD_RETURN_ERROR); ! if (wl->window->last == NULL) { cmdq_error(cmdq, "no last pane"); return (CMD_RETURN_ERROR); } if (args_has(self->args, 'e')) ! wl->window->last->flags &= ~PANE_INPUTOFF; else if (args_has(self->args, 'd')) ! wl->window->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); } return (CMD_RETURN_NORMAL); --- 56,79 ---- wl = cmd_find_window(cmdq, args_get(args, 't'), NULL); if (wl == NULL) return (CMD_RETURN_ERROR); + w = wl->window; ! if (w->last == NULL) { cmdq_error(cmdq, "no last pane"); return (CMD_RETURN_ERROR); } if (args_has(self->args, 'e')) ! w->last->flags &= ~PANE_INPUTOFF; else if (args_has(self->args, 'd')) ! w->last->flags |= PANE_INPUTOFF; else { ! 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,82 **** --- 81,87 ---- 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,150 **** return (CMD_RETURN_NORMAL); } ! if (wp == wl->window->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); } return (CMD_RETURN_NORMAL); --- 140,156 ---- return (CMD_RETURN_NORMAL); } ! 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); } ! 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);