diff --git a/lib/libimhex/include/hex/pattern_language/patterns/pattern.hpp b/lib/libimhex/include/hex/pattern_language/patterns/pattern.hpp index 944c4c18c..e70d21295 100644 --- a/lib/libimhex/include/hex/pattern_language/patterns/pattern.hpp +++ b/lib/libimhex/include/hex/pattern_language/patterns/pattern.hpp @@ -240,6 +240,10 @@ namespace hex::pl { return this->m_cachedDisplayValue.value(); } + void clearFormatCache() { + this->m_cachedDisplayValue.reset(); + } + protected: void createDefaultEntry(const std::string &value, Token::Literal &&literal) const { ImGui::TableNextRow(); diff --git a/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_static.hpp b/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_static.hpp index 29bcc8145..de3270221 100644 --- a/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_static.hpp +++ b/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_static.hpp @@ -55,6 +55,7 @@ namespace hex::pl { if (open) { auto entry = this->m_template->clone(); for (u64 index = 0; index < this->m_entryCount; index++) { + entry->clearFormatCache(); entry->setVariableName(hex::format("[{0}]", index)); entry->setOffset(this->getOffset() + index * this->m_template->getSize()); entry->draw(provider);