From 6cb0d4d7d87c712fe922b6da3b962eb62a94ca4f Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 2 Mar 2024 10:57:13 +0100 Subject: [PATCH] fix: MIME based auto loading not working correctly --- .../builtin/source/content/views/view_pattern_editor.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index 362a58221..7ef601f4b 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -1392,12 +1392,8 @@ namespace hex::plugin::builtin { if (!file.isValid()) continue; - auto &preprocessor = runtime.getInternals().preprocessor; - - pl::api::Source source(file.readString()); - - auto ret = preprocessor->preprocess(&runtime, &source); - if (ret.hasErrs()) { + auto result = runtime.preprocessString(file.readString(), pl::api::Source::DefaultSource); + if (!result.has_value()) { log::warn("Failed to preprocess file {} during MIME analysis", entry.path().string()); }