You've already forked godot
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:
@@ -1174,18 +1174,14 @@ void EditorSettings::_load_default_visual_shader_editor_theme() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String EditorSettings::_guess_exec_args_for_extenal_editor(const String &p_path) {
|
String EditorSettings::_guess_exec_args_for_extenal_editor(const String &p_path) {
|
||||||
Ref<RegEx> regex;
|
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)");
|
||||||
regex.instantiate();
|
Ref<RegExMatch> editor_match = regex->search(p_path.to_lower().get_file().get_basename());
|
||||||
|
|
||||||
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());
|
|
||||||
|
|
||||||
if (editor_match.is_null()) {
|
if (editor_match.is_null()) {
|
||||||
return String();
|
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}";
|
String new_exec_flags = "{file}";
|
||||||
|
|
||||||
if (editor.begins_with("rider")) {
|
if (editor.begins_with("rider")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user