Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix FileSystem dock not unfolding subfolders to show nested files

Michael Alexsander2ea626948198
diff --git a/editor/docks/filesystem_dock.cpp b/editor/docks/filesystem_dock.cpp
index e067e602a2a..f0ea4c0099e 100644
--- a/editor/docks/filesystem_dock.cpp
+++ b/editor/docks/filesystem_dock.cpp
@@ -816,8 +816,13 @@ void FileSystemDock::_navigate_to_path(const String &p_path, bool p_select_in_fa
return;
}
- // Unfold all folders along the path (minus itself).
- TreeItem *ti = (*directory_ptr)->get_parent();
+ // Unfold all folders along the path...
+ TreeItem *ti = *directory_ptr;
+ // ...minus itself, if the target is a folder.
+ if (target_path == base_dir_path) {
+ ti = ti->get_parent();
+ }
+
while (ti) {
ti->set_collapsed(false);
ti = ti->get_parent();