mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
Trim query
This commit is contained in:
@@ -55,11 +55,14 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
|
|||||||
|
|
||||||
protected override List<Result> QueryInternal(Query query)
|
protected override List<Result> QueryInternal(Query query)
|
||||||
{
|
{
|
||||||
|
if (query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List<Result>();
|
||||||
|
string myQuery = query.RawQuery.Trim();
|
||||||
|
|
||||||
List<Result> results = new List<Result>();
|
List<Result> results = new List<Result>();
|
||||||
|
|
||||||
foreach (var item in controlPanelItems)
|
foreach (var item in controlPanelItems)
|
||||||
{
|
{
|
||||||
if (item.LocalizedString.IndexOf(query.RawQuery, StringComparison.OrdinalIgnoreCase) >= 0 || item.InfoTip.IndexOf(query.RawQuery, StringComparison.OrdinalIgnoreCase) >= 0)
|
if (item.LocalizedString.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0 || item.InfoTip.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0)
|
||||||
{
|
{
|
||||||
results.Add(new Result()
|
results.Add(new Result()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user