From fedf9cd3796dabdadb2faf362eaadeb4fded22af Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Fri, 10 May 2019 17:50:43 +0300 Subject: [PATCH] Open selected folder when pressing the "Open" option in the menu An attempt to fix #28798 --- editor/filesystem_dock.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 6248680a52c..109f29cb395 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1489,6 +1489,15 @@ void FileSystemDock::_file_option(int p_option, const Vector p_selected) } break; case FILE_OPEN: { + // Open folders + TreeItem *selected = tree->get_root(); + selected = tree->get_next_selected(selected); + while (selected) { + if (p_selected.find(selected->get_metadata(0)) >= 0) { + selected->set_collapsed(false); + } + selected = tree->get_next_selected(selected); + } // Open the file for (int i = 0; i < p_selected.size(); i++) { _select_file(p_selected[i]);