mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: Make sure placing a type through the Edit menu re-evaluates the pattern
This commit is contained in:
@@ -46,6 +46,7 @@ namespace hex::plugin::builtin {
|
||||
std::vector<std::fs::path> m_possiblePatternFiles;
|
||||
u32 m_selectedPatternFile = 0;
|
||||
bool m_runAutomatically = false;
|
||||
bool m_triggerEvaluation = false;
|
||||
|
||||
bool m_lastEvaluationProcessed = true;
|
||||
bool m_lastEvaluationResult = false;
|
||||
|
||||
@@ -147,7 +147,8 @@ namespace hex::plugin::builtin {
|
||||
if (ImGui::IconButton(ICON_VS_DEBUG_STOP, ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarRed)))
|
||||
runtime->abort();
|
||||
} else {
|
||||
if (ImGui::IconButton(ICON_VS_DEBUG_START, ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarGreen))) {
|
||||
if (ImGui::IconButton(ICON_VS_DEBUG_START, ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarGreen)) || this->m_triggerEvaluation) {
|
||||
this->m_triggerEvaluation = false;
|
||||
this->evaluatePattern(this->m_textEditor.GetText(), provider);
|
||||
}
|
||||
}
|
||||
@@ -869,7 +870,7 @@ namespace hex::plugin::builtin {
|
||||
void ViewPatternEditor::appendEditorText(const std::string &text) {
|
||||
this->m_textEditor.SetCursorPosition(TextEditor::Coordinates { this->m_textEditor.GetTotalLines(), 0 });
|
||||
this->m_textEditor.InsertText(hex::format("\n{0}", text));
|
||||
this->m_hasUnevaluatedChanges = true;
|
||||
this->m_triggerEvaluation = true;
|
||||
}
|
||||
|
||||
void ViewPatternEditor::appendVariable(const std::string &type) {
|
||||
|
||||
Reference in New Issue
Block a user