Skip to content

Commit

Permalink
Open selected folder when pressing the "Open" option in the menu
Browse files Browse the repository at this point in the history
An attempt to fix #28798
  • Loading branch information
bojidar-bg committed May 10, 2019
1 parent ecceabe commit fedf9cd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions editor/filesystem_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,15 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> 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]);
Expand Down

0 comments on commit fedf9cd

Please sign in to comment.