Autocomplete entries keep track of the length of the prefix
in name_prefix_offset. However, the name matching logic
was comparing the string including the prefix which resulted
in tab-completion not working.
This is fixed by passing in a char pointer after the end of
the prefix.
We additionally move some searchbox logic. Previously,
ui_searchbox_apply would clear the entry which would mean
that ui_searchbox_find_index would never succeed. We
move the "clearing" loging out of the function and call it
directly if no match was found.