diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-12-22 10:20:09 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-12-22 10:20:09 +0000 |
commit | 763362426b89d0c160547a9770e3d5185efb8648 (patch) | |
tree | f0ebbd8e6d69965b9ee937f735190729b8baec9f | |
parent | 899a1a4d58ef17755d8f36a7f44d17c2c705ea39 (diff) |
Fix a couple of problems with grouped sessions reported by danh: redraw
properly and choose the correct last window after a window is killed.
-rw-r--r-- | usr.bin/tmux/server-fn.c | 8 | ||||
-rw-r--r-- | usr.bin/tmux/session.c | 10 |
2 files changed, 8 insertions, 10 deletions
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c index e21c3f75894..8364f314913 100644 --- a/usr.bin/tmux/server-fn.c +++ b/usr.bin/tmux/server-fn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-fn.c,v 1.31 2009/12/03 22:50:10 nicm Exp $ */ +/* $OpenBSD: server-fn.c,v 1.32 2009/12/22 10:20:08 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -250,10 +250,8 @@ server_kill_window(struct window *w) if (session_detach(s, wl)) server_destroy_session_group(s); - else { - server_redraw_session(s); - server_status_session_group(s); - } + else + server_redraw_session_group(s); } } diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c index 4890ef8d1c5..f52530879ab 100644 --- a/usr.bin/tmux/session.c +++ b/usr.bin/tmux/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.15 2009/12/03 22:50:10 nicm Exp $ */ +/* $OpenBSD: session.c,v 1.16 2009/12/22 10:20:08 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -549,10 +549,10 @@ session_group_synchronize1(struct session *target, struct session *s) return; /* If the current window has vanished, move to the next now. */ - if (s->curw != NULL) { - while (winlink_find_by_index(ww, s->curw->idx) == NULL) - session_next(s, 0); - } + if (s->curw != NULL && + winlink_find_by_index(ww, s->curw->idx) == NULL && + session_last(s) != 0 && session_previous(s, 0) != 0) + session_next(s, 0); /* Save the old pointer and reset it. */ memcpy(&old_windows, &s->windows, sizeof old_windows); |