When invoking auto completion for a word, don't show the completions
menu if the available matches don't match the beginning of the word
typed by the user.
Previously if no matches were found, the completions menu was invoked
if there were completion items that "contained" the matched word (not
at the beginning of the matches), if that word appeared at a word
beginning, which was marked by a capital letter or an underscore, e.g.
"Foo" would match "BarFoo" and "Bar_Foo". The user can still maunally
invoke the menu.
Use range for instead of foreach.
BUG: 381024
FIXED-IN: 5.61.0