Skip to content

Commit d90a266

Browse files
committed
Merge pull request godotengine#111820 from DeeJayLSP/fix-autoset-exec-flags
Fix autoset of `text_editor/external/exec_flags` not working properly
2 parents f38812f + f8a5e70 commit d90a266

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

editor/settings/editor_settings.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,18 +1174,14 @@ void EditorSettings::_load_default_visual_shader_editor_theme() {
11741174
}
11751175

11761176
String EditorSettings::_guess_exec_args_for_extenal_editor(const String &p_path) {
1177-
Ref<RegEx> regex;
1178-
regex.instantiate();
1179-
1180-
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)?)";
1181-
regex->compile(editor_pattern);
1182-
Ref<RegExMatch> editor_match = regex->search(p_path.to_lower());
1177+
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)");
1178+
Ref<RegExMatch> editor_match = regex->search(p_path.to_lower().get_file().get_basename());
11831179

11841180
if (editor_match.is_null()) {
11851181
return String();
11861182
}
11871183

1188-
const String editor = editor_match->get_string(1).to_lower();
1184+
const String editor = editor_match->get_string(0).to_lower();
11891185
String new_exec_flags = "{file}";
11901186

11911187
if (editor.begins_with("rider")) {

0 commit comments

Comments
 (0)