From 6ce232ae64c68e9d96f9acb04365f563d618c297 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 17 Apr 2014 09:13:14 +0000 Subject: Correct the dance to fix the active pane in join-pane by pulling the (right) code from break-pane and window_remove_pane into a helper function. --- usr.bin/tmux/window.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'usr.bin/tmux/window.c') diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index cf1d176fd26..e0f23c10119 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.104 2014/04/17 07:36:45 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.105 2014/04/17 09:13:13 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -591,7 +591,7 @@ window_add_pane(struct window *w, u_int hlimit) } void -window_remove_pane(struct window *w, struct window_pane *wp) +window_lost_pane(struct window *w, struct window_pane *wp) { if (wp == w->active) { w->active = w->last; @@ -603,6 +603,12 @@ window_remove_pane(struct window *w, struct window_pane *wp) } } else if (wp == w->last) w->last = NULL; +} + +void +window_remove_pane(struct window *w, struct window_pane *wp) +{ + window_lost_pane(w, wp); TAILQ_REMOVE(&w->panes, wp, entry); window_pane_destroy(wp); -- cgit v1.2.3