[PT Run] [Terminal Plugin] Use GetAppListEntires and add scoring (#19148)

* use GetAppListEntires() method

* add scoring
This commit is contained in:
Heiko
2022-07-04 16:19:40 +02:00
committed by GitHub
parent 0da616f917
commit 202abd351b
2 changed files with 15 additions and 12 deletions

View File

@@ -69,13 +69,15 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsTerminal
}
// Action keyword only or search query match
if ((!string.IsNullOrWhiteSpace(query.ActionKeyword) && string.IsNullOrWhiteSpace(search)) || StringMatcher.FuzzySearch(search, profile.Name).Success)
int score = StringMatcher.FuzzySearch(search, profile.Name).Score;
if ((!string.IsNullOrWhiteSpace(query.ActionKeyword) && string.IsNullOrWhiteSpace(search)) || score > 0)
{
result.Add(new Result
{
Title = profile.Name,
SubTitle = profile.Terminal.DisplayName,
Icon = () => GetLogo(profile.Terminal),
Score = score,
Action = _ =>
{
Launch(profile.Terminal.AppUserModelId, profile.Name);