1
0
mirror of synced 2025-01-18 00:56:49 +01:00

fix: Custom pattern include paths not working correctly

This commit is contained in:
WerWolv 2022-08-18 00:30:02 +02:00
parent a56a8c1d6c
commit 1ddd3ea2b9
3 changed files with 12 additions and 1 deletions

View File

@ -31,6 +31,16 @@ namespace hex {
long double operator""_scaled(unsigned long long value);
ImVec2 scaled(const ImVec2 &vector);
template<typename T>
std::vector<T> operator|(const std::vector<T> &lhs, const std::vector<T> &rhs) {
std::vector<T> 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);

View File

@ -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)

View File

@ -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<EventHighlightingChanged>();