mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add loop to check remaining acronyms if previous matched
This commit is contained in:
parent
c395cc74b5
commit
bb6a91124a
1 changed files with 13 additions and 0 deletions
|
|
@ -68,6 +68,8 @@ namespace Flow.Launcher.Infrastructure
|
||||||
|
|
||||||
// preset acronymScore
|
// preset acronymScore
|
||||||
int acronymScore = 100;
|
int acronymScore = 100;
|
||||||
|
int acronymsRemainingNotMatched = 0;
|
||||||
|
int acronymsMatched = 0;
|
||||||
|
|
||||||
var fullStringToCompareWithoutCase = opt.IgnoreCase ? stringToCompare.ToLower() : stringToCompare;
|
var fullStringToCompareWithoutCase = opt.IgnoreCase ? stringToCompare.ToLower() : stringToCompare;
|
||||||
var queryWithoutCase = opt.IgnoreCase ? query.ToLower() : query;
|
var queryWithoutCase = opt.IgnoreCase ? query.ToLower() : query;
|
||||||
|
|
@ -91,6 +93,15 @@ namespace Flow.Launcher.Infrastructure
|
||||||
|
|
||||||
for (var compareStringIndex = 0; compareStringIndex < fullStringToCompareWithoutCase.Length; compareStringIndex++)
|
for (var compareStringIndex = 0; compareStringIndex < fullStringToCompareWithoutCase.Length; compareStringIndex++)
|
||||||
{
|
{
|
||||||
|
if (currentAcronymQueryIndex >= queryWithoutCase.Length && acronymsMatched > 0)
|
||||||
|
{
|
||||||
|
if (char.IsUpper(stringToCompare[compareStringIndex]) ||
|
||||||
|
char.IsNumber(stringToCompare[compareStringIndex]) ||
|
||||||
|
char.IsWhiteSpace(stringToCompare[compareStringIndex]))
|
||||||
|
acronymsRemainingNotMatched++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (currentAcronymQueryIndex >= queryWithoutCase.Length
|
if (currentAcronymQueryIndex >= queryWithoutCase.Length
|
||||||
|| allQuerySubstringsMatched && acronymScore < (int) UserSettingSearchPrecision)
|
|| allQuerySubstringsMatched && acronymScore < (int) UserSettingSearchPrecision)
|
||||||
break;
|
break;
|
||||||
|
|
@ -118,11 +129,13 @@ namespace Flow.Launcher.Infrastructure
|
||||||
char.IsDigit(currentCompareChar))
|
char.IsDigit(currentCompareChar))
|
||||||
{
|
{
|
||||||
acronymMatchData.Add(compareStringIndex);
|
acronymMatchData.Add(compareStringIndex);
|
||||||
|
acronymsMatched++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!(spaceMet = char.IsWhiteSpace(stringToCompare[compareStringIndex])))
|
else if (!(spaceMet = char.IsWhiteSpace(stringToCompare[compareStringIndex])))
|
||||||
{
|
{
|
||||||
acronymMatchData.Add(compareStringIndex);
|
acronymMatchData.Add(compareStringIndex);
|
||||||
|
acronymsMatched++;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentAcronymQueryIndex++;
|
currentAcronymQueryIndex++;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue