mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
Update Initialisation of plugin method
Handle when plugin has a mix of global and non-global action keywords
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -106,16 +106,12 @@ namespace Wox.Core.Plugin
|
|||||||
foreach (var plugin in AllPlugins)
|
foreach (var plugin in AllPlugins)
|
||||||
{
|
{
|
||||||
if (IsGlobalPlugin(plugin.Metadata))
|
if (IsGlobalPlugin(plugin.Metadata))
|
||||||
{
|
|
||||||
GlobalPlugins.Add(plugin);
|
GlobalPlugins.Add(plugin);
|
||||||
}
|
|
||||||
else
|
// Plugins may have multiple ActionKeywords, eg. WebSearch
|
||||||
{
|
plugin.Metadata.ActionKeywords.Where(x => x != Query.GlobalPluginWildcardSign)
|
||||||
foreach (string actionKeyword in plugin.Metadata.ActionKeywords)
|
.ToList()
|
||||||
{
|
.ForEach(x => NonGlobalPlugins[x] = plugin);
|
||||||
NonGlobalPlugins[actionKeyword] = plugin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user