mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb2af5593f | ||
|
|
e938b75acd | ||
|
|
03daf0c95b | ||
|
|
189ea1c3c7 | ||
|
|
8448c3367b | ||
|
|
cc29707bb1 | ||
|
|
eff9ecf7cd |
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
Submodule lib/external/pattern_language updated: 7285b76f82...9612e699de
@@ -292,7 +292,7 @@ namespace hex::prv {
|
||||
}
|
||||
|
||||
if (!nextRegionAddress.has_value())
|
||||
return { Region { address, this->getActualSize() - address }, true };
|
||||
return { Region::Invalid(), false };
|
||||
else
|
||||
return { Region { address, *nextRegionAddress - address }, insideValidRegion };
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace hex::plugin::builtin {
|
||||
for (const auto &id : providerIds) {
|
||||
auto providerSettings = nlohmann::json::parse(tar.readString(basePath / hex::format("{}.json", id)));
|
||||
|
||||
auto provider = ImHexApi::Provider::createProvider(providerSettings["type"].get<std::string>());
|
||||
auto provider = ImHexApi::Provider::createProvider(providerSettings["type"].get<std::string>(), true);
|
||||
if (provider == nullptr) {
|
||||
success = false;
|
||||
continue;
|
||||
|
||||
@@ -332,7 +332,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
bool open = true;
|
||||
ImGui::PushID(tabProvider);
|
||||
if (ImGui::BeginTabItem(tabProvider->getName().c_str(), &open, provider->isDirty() ? ImGuiTabItemFlags_UnsavedDocument : ImGuiTabItemFlags_None)) {
|
||||
if (ImGui::BeginTabItem(tabProvider->getName().c_str(), &open, tabProvider->isDirty() ? ImGuiTabItemFlags_UnsavedDocument : ImGuiTabItemFlags_None)) {
|
||||
ImHexApi::Provider::setCurrentProvider(i);
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
@@ -403,10 +403,14 @@ namespace hex::plugin::builtin {
|
||||
if (this->m_hasUnevaluatedChanges && this->m_runningEvaluators == 0 && this->m_runningParsers == 0) {
|
||||
this->m_hasUnevaluatedChanges = false;
|
||||
|
||||
if (this->m_runAutomatically)
|
||||
this->evaluatePattern(this->m_textEditor.GetText());
|
||||
else
|
||||
std::thread([this, code = this->m_textEditor.GetText()] { this->parsePattern(code); }).detach();
|
||||
|
||||
std::thread([this, code = this->m_textEditor.GetText()]{
|
||||
this->parsePattern(code);
|
||||
|
||||
if (this->m_runAutomatically)
|
||||
this->evaluatePattern(code);
|
||||
}).detach();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -767,8 +771,6 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
void ViewPatternEditor::parsePattern(const std::string &code) {
|
||||
auto task = ImHexApi::Tasks::createTask("hex.builtin.view.pattern_editor.evaluating", 1);
|
||||
|
||||
this->m_runningParsers++;
|
||||
|
||||
auto ast = this->m_parserRuntime->parseString(code);
|
||||
@@ -821,8 +823,6 @@ namespace hex::plugin::builtin {
|
||||
for (const auto &[id, name, value, type] : this->m_envVarEntries)
|
||||
envVars.insert({ name, value });
|
||||
|
||||
this->parsePattern(code);
|
||||
|
||||
std::map<std::string, pl::core::Token::Literal> inVariables;
|
||||
for (auto &[name, variable] : this->m_patternVariables) {
|
||||
if (variable.inVariable)
|
||||
|
||||
@@ -215,6 +215,9 @@ namespace hex::plugin::builtin {
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 5_scaled);
|
||||
{
|
||||
for (const auto &recentProvider : s_recentProviders) {
|
||||
ImGui::PushID(&recentProvider);
|
||||
ON_SCOPE_EXIT { ImGui::PopID(); };
|
||||
|
||||
if (ImGui::BulletHyperlink(recentProvider.displayName.c_str())) {
|
||||
loadRecentProvider(recentProvider);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user