fix: Pattern files not getting truncated correctly when saving

Fixes #2566

(cherry picked from commit 932c281223)
This commit is contained in:
WerWolv
2025-12-16 10:02:10 +01:00
parent a44278b1fe
commit 11df253fd3

View File

@@ -2641,7 +2641,7 @@ namespace hex::plugin::builtin {
if (provider == nullptr)
return;
auto path = m_changeTracker.get(provider).getPath();
wolv::io::File file(path, wolv::io::File::Mode::Write);
wolv::io::File file(path, wolv::io::File::Mode::Create);
if (file.isValid() && trackFile) {
if (isPatternDirty(provider)) {
file.writeString(wolv::util::trim(m_textEditor.get(provider).getText()));