=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/window-choose.c,v retrieving revision 1.57 retrieving revision 1.58 diff -c -r1.57 -r1.58 *** src/usr.bin/tmux/Attic/window-choose.c 2014/11/30 08:03:29 1.57 --- src/usr.bin/tmux/Attic/window-choose.c 2015/01/15 13:43:13 1.58 *************** *** 1,4 **** ! /* $OpenBSD: window-choose.c,v 1.57 2014/11/30 08:03:29 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window-choose.c,v 1.58 2015/01/15 13:43:13 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 330,343 **** struct window_choose_mode_data *data = wp->modedata; struct window_choose_mode_item *item, *chosen; struct window_choose_data *wcd; ! u_int i, pos; ARRAY_DECL(, struct window_choose_mode_item) list_copy; ARRAY_INIT(&list_copy); ! pos = data->selected; ! ! chosen = &ARRAY_ITEM(&data->list, pos); chosen->state &= ~TREE_EXPANDED; /* --- 330,341 ---- struct window_choose_mode_data *data = wp->modedata; struct window_choose_mode_item *item, *chosen; struct window_choose_data *wcd; ! u_int i; ARRAY_DECL(, struct window_choose_mode_item) list_copy; ARRAY_INIT(&list_copy); ! chosen = &ARRAY_ITEM(&data->list, data->selected); chosen->state &= ~TREE_EXPANDED; /* *************** *** 353,361 **** /* We only show the session when collapsed. */ if (wcd->type & TREE_SESSION) { item->state &= ~TREE_EXPANDED; - ARRAY_ADD(&list_copy, - ARRAY_ITEM(&data->list, i)); /* * Update the selection to this session item so * we don't end up highlighting a non-existent --- 351,358 ---- /* We only show the session when collapsed. */ if (wcd->type & TREE_SESSION) { item->state &= ~TREE_EXPANDED; + ARRAY_ADD(&list_copy, *item); /* * Update the selection to this session item so * we don't end up highlighting a non-existent