This is a quality of live improvement. It's quite common that when something is searched for, it will be searched for again soonish. Therefore it makes sense to rank the recently selected items higher.
This also removes the behavior that the old search string remains in the search box, which is not really helpful anymore and can be annoying.
The implementation uses a global list of recent search items that is stored in the Global struct. It doesn't seem necessary to store this per search. The list of recent searches does not impact which search items will show when opening a new search, only their order.
Future improvements:
- Store recent searches in a file like recent-files.txt so that they persist when Blender closes.
- Have max number of recent searches or the ability to clear the recent searches.
