diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index 5e76c63e8..51745ce6d 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -109,13 +109,12 @@ namespace hex::plugin::builtin { }); EventManager::subscribe(this, [this](prv::Provider *provider) { + auto &patternLanguageData = ProviderExtraData::get(provider).patternLanguage; + patternLanguageData.runtime = ContentRegistry::PatternLanguage::createDefaultRuntime(provider); + if (!this->m_autoLoadPatterns) return; - auto &patternLanguageData = ProviderExtraData::get(provider).patternLanguage; - - patternLanguageData.runtime = ContentRegistry::PatternLanguage::createDefaultRuntime(provider); - // Copy over current pattern source code to the new provider if (!this->m_syncPatternSourceCode) { patternLanguageData.sourceCode = this->m_textEditor.GetText();