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 @@ -1174,18 +1174,14 @@ void EditorSettings::_load_default_visual_shader_editor_theme() {
11741174}
11751175
11761176String 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" )) {
You can’t perform that action at this time.
0 commit comments