diff --git a/plugins/builtin/source/content/command_palette_commands.cpp b/plugins/builtin/source/content/command_palette_commands.cpp index 8b63dd864..a0d207cb2 100644 --- a/plugins/builtin/source/content/command_palette_commands.cpp +++ b/plugins/builtin/source/content/command_palette_commands.cpp @@ -1,12 +1,15 @@ #include +#include #include #include #include #include +#include #include +#include #include namespace hex::plugin::builtin { @@ -312,6 +315,32 @@ namespace hex::plugin::builtin { return hex::format("Menu Item: {}", input.data()); }); + ContentRegistry::CommandPaletteCommands::addHandler( + ContentRegistry::CommandPaletteCommands::Type::SymbolCommand, + ".", + [](const auto &input) { + std::vector result; + + u32 index = 0; + for (const auto &provider : ImHexApi::Provider::getProviders()) { + ON_SCOPE_EXIT { index += 1; }; + + auto name = provider->getName(); + if (!hex::containsIgnoreCase(name, input)) + continue; + + result.emplace_back(ContentRegistry::CommandPaletteCommands::impl::QueryResult { + provider->getName(), + [&provider, index](const auto&) { ImHexApi::Provider::setCurrentProvider(index); } + }); + } + + return result; + }, + [](auto input) { + return hex::format("Provider: {}", input.data()); + }); + ContentRegistry::CommandPaletteCommands::add( ContentRegistry::CommandPaletteCommands::Type::SymbolCommand, "%",