1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Sort updated autocomplete results

This commit is contained in:
Simon Lübeß 2021-12-20 13:35:58 +01:00
parent 04888b8f10
commit ac99191487
3 changed files with 106 additions and 47 deletions

View file

@ -8007,8 +8007,12 @@ void BfCompiler::GenerateAutocompleteInfo()
{
entries.Add(&entry);
}
std::sort(entries.begin(), entries.end(), [](AutoCompleteEntry* lhs, AutoCompleteEntry* rhs)
{
if (lhs->mScore == rhs->mScore)
return stricmp(lhs->mDisplay, rhs->mDisplay) < 0;
return lhs->mScore > rhs->mScore;
});