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

Merge pull request #56630 from Pineapple/replace-find-last

This commit is contained in:
Rémi Verschelde
2022-01-18 16:36:52 +01:00
committed by GitHub
18 changed files with 35 additions and 43 deletions

View File

@@ -944,7 +944,7 @@ void EditorFileDialog::set_current_file(const String &p_file) {
file->set_text(p_file);
update_dir();
invalidate();
int lp = p_file.find_last(".");
int lp = p_file.rfind(".");
if (lp != -1) {
file->select(0, lp);
file->grab_focus();
@@ -958,7 +958,7 @@ void EditorFileDialog::set_current_path(const String &p_path) {
if (!p_path.size()) {
return;
}
int pos = MAX(p_path.find_last("/"), p_path.find_last("\\"));
int pos = MAX(p_path.rfind("/"), p_path.rfind("\\"));
if (pos == -1) {
set_current_file(p_path);
} else {