choose-tree: Reset top when toggling items
commite6af0ad23e1a43add71dd09a03c05057aab26748
authornicm <nicm>
Thu, 10 Oct 2013 11:58:52 +0000 (10 11:58 +0000)
committernicm <nicm>
Thu, 10 Oct 2013 11:58:52 +0000 (10 11:58 +0000)
tree57bb39790e3ed8e3eb07b43f93300eb5397af064
parent34674bb180176662d51b774cfcd9f335f329f235
choose-tree: Reset top when toggling items

When choose-tree is told to expand/collapse items (especially when first
rendering collapsed to just show sessions), ensure that in addition to
setting the selected item, that the item itself appears on the bottom of
the screen, rather than off screen.

This was causing rendering glitches when a very small tmux window tried
to render a list of items in choose-tree much larger than itself, and
the selected item appeared off screen, and didn't show the selection
until the selection had wrapped around to the top of the screen.
window-choose.c