-/* $OpenBSD: cmd-break-pane.c,v 1.22 2013/10/10 12:00:18 nicm Exp $ */
+/* $OpenBSD: cmd-break-pane.c,v 1.23 2014/04/17 09:13:13 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
server_unzoom_window(w);
TAILQ_REMOVE(&w->panes, wp, entry);
- if (wp == w->active) {
- w->active = w->last;
- w->last = NULL;
- if (w->active == NULL) {
- w->active = TAILQ_PREV(wp, window_panes, entry);
- if (w->active == NULL)
- w->active = TAILQ_NEXT(wp, entry);
- }
- } else if (wp == w->last)
- w->last = NULL;
+ window_lost_pane(w, wp);
layout_close_pane(wp);
w = wp->window = window_create1(s->sx, s->sy);
-/* $OpenBSD: cmd-join-pane.c,v 1.15 2013/10/10 12:00:19 nicm Exp $ */
+/* $OpenBSD: cmd-join-pane.c,v 1.16 2014/04/17 09:13:13 nicm Exp $ */
/*
* Copyright (c) 2011 George Nachman <tmux@georgester.com>
layout_close_pane(src_wp);
- if (src_w->active == src_wp) {
- src_w->active = TAILQ_PREV(src_wp, window_panes, entry);
- if (src_w->active == NULL)
- src_w->active = TAILQ_NEXT(src_wp, entry);
- }
+ window_lost_pane(src_w, src_wp);
TAILQ_REMOVE(&src_w->panes, src_wp, entry);
if (window_count_panes(src_w) == 0)
-/* $OpenBSD: tmux.h,v 1.452 2014/04/17 07:55:43 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.453 2014/04/17 09:13:13 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
void window_resize(struct window *, u_int, u_int);
int window_zoom(struct window_pane *);
int window_unzoom(struct window *);
+void window_lost_pane(struct window *, struct window_pane *);
void window_remove_pane(struct window *, struct window_pane *);
struct window_pane *window_pane_at_index(struct window *, u_int);
struct window_pane *window_pane_next_by_number(struct window *,
-/* $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 <nicm@users.sourceforge.net>
}
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;
}
} 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);