Currently the search box selects the first item in the list that
matches the string. It is a simple behavior, but it actually doesn't
act that intuitively, and can result in wrong Paste behavior by
choosing an alphabetically earlier long item over an exact match.
This attempts to improve the behavior by trying to minimize the
length of the prefix before the match, and alphabetically comparing
the tail just in case the list isn't sorted. Overall this should
prefer the shortest match, with some weight given to word boundaries.
For example, given "ACube12", "BCube1" and "Cube", it will prefer
"Cube" when searching for "Cube", and "BCube1" when searching for