diff options
author | 2013-10-10 11:58:24 +0000 | |
---|---|---|
committer | 2013-10-10 11:58:24 +0000 | |
commit | 18d0989cbe9601e7449d1daf32b31d117292eb60 (patch) | |
tree | a17a0161eb89dfeef3c3918dbbd87854cf8f9559 /usr.bin/tmux/session.c | |
parent | Assign mouse x/y coords before checking them. When receiving mouse (diff) | |
download | wireguard-openbsd-18d0989cbe9601e7449d1daf32b31d117292eb60.tar.xz wireguard-openbsd-18d0989cbe9601e7449d1daf32b31d117292eb60.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. Patch by Thomas Adam.
Diffstat (limited to 'usr.bin/tmux/session.c')
-rw-r--r-- | usr.bin/tmux/session.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c index 415c5424321..245f920fcb0 100644 --- a/usr.bin/tmux/session.c +++ b/usr.bin/tmux/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.39 2013/10/10 11:46:29 nicm Exp $ */ +/* $OpenBSD: session.c,v 1.40 2013/10/10 11:58:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -616,7 +616,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); } |