search: suggest the correct search pattern type
Created by: rvantonder
Before this PR: timeouts always append and suggest patterntype:regexp
. There is some implicit UI change to the query where the patterntype for regexp and literal search is erased from the query box. This is not the case for structural search. So, here are possible invalid suggestions that crop up:
-
patterntype:regexp
is suggested when literal search was run -
patterntype:structural
andpatterntype:regexp
are both in the suggestion box when structural search times out.
This PR reports the correct patterntype
for the search mode. I am sad that this change doesn't break anything and doesn't have tests, so I have added some, alexa play despacito, and tested manually with the other search types active: