From c9342d90fba56ebd553b0d8c24ccddf7b197ff1c Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 20 Mar 2023 08:29:00 +0100 Subject: [PATCH] fix: Prevent new line from appearing on every pl code save Fixes #982 --- lib/external/pattern_language | 2 +- plugins/builtin/source/content/views/view_pattern_editor.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/external/pattern_language b/lib/external/pattern_language index 0046a79f7..5ca81bbe2 160000 --- a/lib/external/pattern_language +++ b/lib/external/pattern_language @@ -1 +1 @@ -Subproject commit 0046a79f7449030098ffef3f763cc8fb10bd343f +Subproject commit 5ca81bbe2fb32e6059f3a887d03da2fa6f39cea1 diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index d8cc56471..5d6870269 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -895,7 +895,7 @@ namespace hex::plugin::builtin { [this](const auto &path) { wolv::io::File file(path, wolv::io::File::Mode::Create); - file.write(this->m_textEditor.GetText()); + file.write(wolv::util::trim(this->m_textEditor.GetText())); }); } }); @@ -1057,7 +1057,7 @@ namespace hex::plugin::builtin { else sourceCode = ProviderExtraData::get(provider).patternLanguage.sourceCode; - tar.write(basePath, sourceCode); + tar.write(basePath, wolv::util::trim(sourceCode)); return true; } });