diff --git a/lib/libimhex/include/hex/helpers/utils.hpp b/lib/libimhex/include/hex/helpers/utils.hpp index f56662545..b2edc4ff4 100644 --- a/lib/libimhex/include/hex/helpers/utils.hpp +++ b/lib/libimhex/include/hex/helpers/utils.hpp @@ -31,6 +31,16 @@ namespace hex { long double operator""_scaled(unsigned long long value); ImVec2 scaled(const ImVec2 &vector); + template + std::vector operator|(const std::vector &lhs, const std::vector &rhs) { + std::vector result; + + std::copy(lhs.begin(), lhs.end(), std::back_inserter(result)); + std::copy(rhs.begin(), rhs.end(), std::back_inserter(result)); + + return result; + } + std::string to_string(u128 value); std::string to_string(i128 value); diff --git a/lib/libimhex/source/api/content_registry.cpp b/lib/libimhex/source/api/content_registry.cpp index e8b296df6..47dcc4e5a 100644 --- a/lib/libimhex/source/api/content_registry.cpp +++ b/lib/libimhex/source/api/content_registry.cpp @@ -250,7 +250,7 @@ namespace hex { }, provider->getBaseAddress(), provider->getActualSize()); } - runtime->setIncludePaths(fs::getDefaultPaths(fs::ImHexPath::PatternsInclude)); + runtime->setIncludePaths(fs::getDefaultPaths(fs::ImHexPath::PatternsInclude) | fs::getDefaultPaths(fs::ImHexPath::Patterns)); for (const auto &func : getFunctions()) { if (func.dangerous) diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index 113e26431..16e977e11 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -812,6 +812,7 @@ namespace hex::plugin::builtin { auto &runtime = ProviderExtraData::getCurrent().patternLanguage.runtime; runtime->reset(); + runtime->setIncludePaths(fs::getDefaultPaths(fs::ImHexPath::PatternsInclude) | fs::getDefaultPaths(fs::ImHexPath::Patterns)); EventManager::post();