mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
[PT Run] [Terminal Plugin] Use GetAppListEntires and add scoring (#19148)
* use GetAppListEntires() method * add scoring
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user