1
0
mirror of synced 2024-11-24 15:50:16 +01:00

impr: Properly clear pattern editor when closing last provider

This commit is contained in:
WerWolv 2024-03-15 21:07:21 +01:00
parent 5aa1046541
commit 31c93c8c5c
2 changed files with 2 additions and 6 deletions

View File

@ -170,7 +170,7 @@ namespace hex::plugin::builtin {
u32 color;
};
std::unique_ptr<pl::PatternLanguage> m_editorRuntime;
std::unique_ptr<pl::PatternLanguage> m_editorRuntime;
PerProvider<std::vector<std::fs::path>> m_possiblePatternFiles;
bool m_runAutomatically = false;

View File

@ -1686,12 +1686,8 @@ namespace hex::plugin::builtin {
if (newProvider != nullptr)
m_textEditor.SetText(m_sourceCode.get(newProvider));
});
EventProviderClosed::subscribe(this, [this](prv::Provider *) {
if (ImHexApi::Provider::getProviders().empty()) {
else
m_textEditor.SetText("");
}
});
RequestAddVirtualFile::subscribe(this, [this](const std::fs::path &path, const std::vector<u8> &data, Region region) {