From 16d957174317cb512a801cd2f7ad50cfbedb950e Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 28 Aug 2021 16:16:06 +0200 Subject: [PATCH] sys: Mark project file as dirty when modifying pattern --- source/views/view_pattern.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/views/view_pattern.cpp b/source/views/view_pattern.cpp index d1f6c9e19..dcae2a058 100644 --- a/source/views/view_pattern.cpp +++ b/source/views/view_pattern.cpp @@ -262,7 +262,7 @@ namespace hex { ImGui::EndChild(); ImGui::PopStyleColor(1); - ImGui::Disabled([this]{ + ImGui::Disabled([this] { ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(ImColor(0x20, 0x85, 0x20))); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1); @@ -275,12 +275,15 @@ namespace hex { ImGui::SameLine(); if (this->m_evaluatorRunning) - ImGui::TextSpinner("hex.view.pattern.evaluating"_lang); + ImGui::TextSpinner("hex.view.pattern.evaluating"_lang); else ImGui::Checkbox("hex.view.pattern.auto"_lang, &this->m_runAutomatically); - if (this->m_textEditor.IsTextChanged() && this->m_runAutomatically) { - this->parsePattern(this->m_textEditor.GetText().data()); + if (this->m_textEditor.IsTextChanged()) { + if (this->m_runAutomatically) + this->parsePattern(this->m_textEditor.GetText().data()); + + ProjectFile::markDirty(); } }