1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Replace String::find_last with rfind where possible (backward compatible with old API)

This commit is contained in:
Bartłomiej T. Listwon
2022-01-08 22:40:44 +01:00
parent 37b9aba458
commit 22750b1c03
18 changed files with 35 additions and 43 deletions

View File

@@ -75,7 +75,7 @@ void ScriptCreateDialog::_notification(int p_what) {
void ScriptCreateDialog::_path_hbox_sorted() {
if (is_visible()) {
int filename_start_pos = initial_bp.find_last("/") + 1;
int filename_start_pos = initial_bp.rfind("/") + 1;
int filename_end_pos = initial_bp.length();
if (!is_built_in) {
@@ -554,7 +554,7 @@ void ScriptCreateDialog::_file_selected(const String &p_file) {
_path_changed(p);
String filename = p.get_file().get_basename();
int select_start = p.find_last(filename);
int select_start = p.rfind(filename);
file_path->select(select_start, select_start + filename.length());
file_path->set_cursor_position(select_start + filename.length());
file_path->grab_focus();