garybernhardt/selecta — pull request #65 by stewart (2014-12-14 03:26:14+00:00)
Title: Correct IndexError when scrolling through matches

Since `choices` never changes when filtering matches, it would let `up` and `down` scoll past the current number of matches, resulting in an `IndexError` when rendering.

`matches`, however, gives accurate bounds for scrolling.

I'm unsure if `choices.count` still needs to be in `#max_visible_choices`, since with a blank search string it and `matches.count` are equal. I'll remove it if you want me to.

The bug in question:

![IndexError Bug](http://i.imgur.com/SO7ZGfC.gif)