Merge pull request #1315 from dalf/autocomplete-no-duplicate

Autocomplete: don't suggest the current query.
This commit is contained in:
Markus Heiser 2022-06-12 12:26:59 +02:00 committed by GitHub
commit 1bc5455db1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -909,7 +909,8 @@ def autocompleter():
for result in raw_results:
# attention: this loop will change raw_text_query object and this is
# the reason why the sug_prefix was stored before (see above)
results.append(raw_text_query.changeQuery(result).getFullQuery())
if result != sug_prefix:
results.append(raw_text_query.changeQuery(result).getFullQuery())
if len(raw_text_query.autocomplete_list) > 0:
for autocomplete_text in raw_text_query.autocomplete_list: