aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2013-08-13 21:56:41 +0100
committerThomas Adam <thomas@xteddy.org>2013-08-20 00:04:07 +0100
commit5532766b1935a8888fb60fb9a238f0849b96050b (patch)
treead4259591fcff555613790a295d877f05b20ff88
parent5dbf3cb036d8093599494b8c02407e8d2d079f0d (diff)
downloadrtmux-5532766b1935a8888fb60fb9a238f0849b96050b.tar.gz
rtmux-5532766b1935a8888fb60fb9a238f0849b96050b.tar.bz2
rtmux-5532766b1935a8888fb60fb9a238f0849b96050b.zip
Renumber windows: Lookup lastw via window not index
When calling 'movew -r' on a session to reorder the winlinks, ensure when adding back in the information for the lastw stack that we look up the winlink based on the window and not its index. Using the index doesn't make sense here because when comparing it to the old set, it will never match since the winlink has been renumbered. Bug reported by Ben Boeckel.
-rw-r--r--session.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/session.c b/session.c
index 24e2e5e7..bb742d8f 100644
--- a/session.c
+++ b/session.c
@@ -615,7 +615,7 @@ session_renumber_windows(struct session *s)
memcpy(&old_lastw, &s->lastw, sizeof old_lastw);
TAILQ_INIT(&s->lastw);
TAILQ_FOREACH(wl, &old_lastw, sentry) {
- wl_new = winlink_find_by_index(&s->windows, wl->idx);
+ wl_new = winlink_find_by_window(&s->windows, wl->window);
if (wl_new != NULL)
TAILQ_INSERT_TAIL(&s->lastw, wl_new, sentry);
}