mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Enable search for Windows shortcuts using both localized and English names
Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com>
This commit is contained in:
parent
c2ab601abb
commit
b25f9e8366
1 changed files with 22 additions and 5 deletions
|
|
@ -112,12 +112,34 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
{
|
||||
title = resultName;
|
||||
matchResult = Main.Context.API.FuzzySearch(query, resultName);
|
||||
|
||||
// When there's a localized name, also search the original English name
|
||||
// This allows users to search using either the localized name or the English filename
|
||||
if (useLocalizedName)
|
||||
{
|
||||
var englishNameMatch = Main.Context.API.FuzzySearch(query, Name);
|
||||
if (englishNameMatch.Score > matchResult.Score)
|
||||
{
|
||||
matchResult = englishNameMatch;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Search in both
|
||||
title = $"{resultName}: {Description}";
|
||||
var nameMatch = Main.Context.API.FuzzySearch(query, resultName);
|
||||
|
||||
// When there's a localized name, also search the original English name
|
||||
if (useLocalizedName)
|
||||
{
|
||||
var englishNameMatch = Main.Context.API.FuzzySearch(query, Name);
|
||||
if (englishNameMatch.Score > nameMatch.Score)
|
||||
{
|
||||
nameMatch = englishNameMatch;
|
||||
}
|
||||
}
|
||||
|
||||
var descriptionMatch = Main.Context.API.FuzzySearch(query, Description);
|
||||
if (descriptionMatch.Score > nameMatch.Score)
|
||||
{
|
||||
|
|
@ -143,11 +165,6 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
candidates.Add(ExecutableName);
|
||||
}
|
||||
|
||||
if (useLocalizedName)
|
||||
{
|
||||
candidates.Add(Name);
|
||||
}
|
||||
|
||||
matchResult = Match(query, candidates);
|
||||
if (matchResult == null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue