1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #111820 from DeeJayLSP/fix-autoset-exec-flags

Fix autoset of `text_editor/external/exec_flags` not working properly
This commit is contained in:
Thaddeus Crews
2025-10-23 11:03:49 -05:00

View File

@@ -1174,18 +1174,14 @@ void EditorSettings::_load_default_visual_shader_editor_theme() {
}
String EditorSettings::_guess_exec_args_for_extenal_editor(const String &p_path) {
Ref<RegEx> 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<RegExMatch> editor_match = regex->search(p_path.to_lower());
Ref<RegEx> 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<RegExMatch> 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")) {