[PT Run] Settings plugin: Settings path filter and bug fixes (#13151)

* Create filter method

* adding call of new method

* solve bug #13150

* fixes and comment updates

* fix typos

* Update filter method

* Improve performance on empty queries

* fix typos
This commit is contained in:
Heiko
2021-09-15 19:37:36 +02:00
committed by GitHub
parent a0a355c3a7
commit 8e350ca4a7
2 changed files with 95 additions and 24 deletions

View File

@@ -110,6 +110,12 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsSettings
bool Predicate(WindowsSetting found)
{
if (string.IsNullOrWhiteSpace(query.Search))
{
// If no search string is entered skip query comparison.
return true;
}
if (found.Name.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))
{
return true;
@@ -145,6 +151,12 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsSettings
}
}
// Search by key char '>' for app name and settings path
if (query.Search.Contains('>'))
{
return ResultHelper.FilterBySettingsPath(found, query.Search);
}
return false;
}
}