You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #56630 from Pineapple/replace-find-last
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user