From f8a5e704d63f0da5753e28a475954dbbad1ae4b2 Mon Sep 17 00:00:00 2001 From: DeeJayLSP Date: Sun, 19 Oct 2025 10:29:58 -0300 Subject: [PATCH] Fix autoset of `text_editor/external/exec_flags` not working properly --- editor/settings/editor_settings.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/editor/settings/editor_settings.cpp b/editor/settings/editor_settings.cpp index 9bbeab7b9b1..ac115e7ed65 100644 --- a/editor/settings/editor_settings.cpp +++ b/editor/settings/editor_settings.cpp @@ -1171,18 +1171,14 @@ void EditorSettings::_load_default_visual_shader_editor_theme() { } String EditorSettings::_guess_exec_args_for_extenal_editor(const String &p_path) { - Ref regex; - regex.instantiate(); - - const String editor_pattern = R"([\\/]((?:jetbrains\s*)?rider(?:\s*(eap|\d{4}\.\d+|\d{4}\.\d+\s*dev)?)?|visual\s*studio\s*code|subl(ime\s*text)?|sublime_text|(g)?vim|emacs|atom|geany|kate|code|(vs)?codium)(?:\.app|\.exe|\.bat|\.sh)?)"; - regex->compile(editor_pattern); - Ref editor_match = regex->search(p_path.to_lower()); + Ref regex = RegEx::create_from_string(R"((?:jetbrains\s*)?rider(?:\s*(eap|\d{4}\.\d+|\d{4}\.\d+\s*dev)?)?|visual\s*studio\s*code|subl(ime\s*text)?|sublime_text|(g)?vim|emacs|atom|geany|kate|code|(vs)?codium)"); + Ref editor_match = regex->search(p_path.to_lower().get_file().get_basename()); if (editor_match.is_null()) { return String(); } - const String editor = editor_match->get_string(1).to_lower(); + const String editor = editor_match->get_string(0).to_lower(); String new_exec_flags = "{file}"; if (editor.begins_with("rider")) {