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

Fix autoset of text_editor/external/exec_flags not working properly

This commit is contained in:
DeeJayLSP
2025-10-19 10:29:58 -03:00
parent 7864ac8019
commit f8a5e704d6

View File

@@ -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;
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")) {