File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -1171,18 +1171,14 @@ void EditorSettings::_load_default_visual_shader_editor_theme() {
11711171}
11721172
11731173String EditorSettings::_guess_exec_args_for_extenal_editor (const String &p_path) {
1174- Ref<RegEx> regex;
1175- regex.instantiate ();
1176-
1177- 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)?)" ;
1178- regex->compile (editor_pattern);
1179- Ref<RegExMatch> editor_match = regex->search (p_path.to_lower ());
1174+ 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)" );
1175+ Ref<RegExMatch> editor_match = regex->search (p_path.to_lower ().get_file ().get_basename ());
11801176
11811177 if (editor_match.is_null ()) {
11821178 return String ();
11831179 }
11841180
1185- const String editor = editor_match->get_string (1 ).to_lower ();
1181+ const String editor = editor_match->get_string (0 ).to_lower ();
11861182 String new_exec_flags = " {file}" ;
11871183
11881184 if (editor.begins_with (" rider" )) {
You can’t perform that action at this time.
0 commit comments