Fix #8468. Respect last_idx in prefix searching.
Merge pull request #8481 from blakejohnson/prefix-down-arrow

Fix #8468. Respect last_idx in prefix searching.