diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 93bfe951109..5eb18b2c1b3 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1191,7 +1191,7 @@ HashSet FileSystemDock::_get_valid_conversions_for_file_paths(const Vect return all_valid_conversion_to_targets; } -void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites) { +void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites, bool p_navigate) { String fpath = p_path; if (fpath.ends_with("/")) { // Ignore a directory. @@ -1258,7 +1258,9 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit EditorNode::get_singleton()->load_resource(fpath); } } - _navigate_to_path(fpath, p_select_in_favorites); + if (p_navigate) { + _navigate_to_path(fpath, p_select_in_favorites); + } } void FileSystemDock::_tree_activate_file() { @@ -1272,7 +1274,7 @@ void FileSystemDock::_tree_activate_file() { bool collapsed = selected->is_collapsed(); selected->set_collapsed(!collapsed); } else { - _select_file(file_path, is_favorite && !file_path.ends_with("/")); + _select_file(file_path, is_favorite && !file_path.ends_with("/"), false); } } } diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index d2e403a8aff..73462df36f1 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -262,7 +262,7 @@ private: void _set_file_display(bool p_active); void _fs_changed(); - void _select_file(const String &p_path, bool p_select_in_favorites = false); + void _select_file(const String &p_path, bool p_select_in_favorites = false, bool p_navigate = true); void _tree_activate_file(); void _file_list_activate_file(int p_idx); void _file_multi_selected(int p_index, bool p_selected);