Skip to content

Commit d5eacef

Browse files
committed
Merge pull request godotengine#102336 from Maran23/show-in-filesystem-fix
Fix 'Show in FileSystem' jumps to incorrect entry under certain conditions
2 parents 4186f57 + f0ae69e commit d5eacef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

editor/filesystem_dock.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,8 @@ void FileSystemDock::_navigate_to_path(const String &p_path, bool p_select_in_fa
746746
// Select the file or directory in the tree.
747747
tree->deselect_all();
748748
if (display_mode == DISPLAY_MODE_TREE_ONLY) {
749-
const String file_name = is_directory ? target_path.trim_suffix("/").get_file() + "/" : target_path.get_file();
749+
// Either search for 'folder/' or '/file.ext'.
750+
const String file_name = is_directory ? target_path.trim_suffix("/").get_file() + "/" : "/" + target_path.get_file();
750751
TreeItem *item = is_directory ? *directory_ptr : (*directory_ptr)->get_first_child();
751752
while (item) {
752753
if (item->get_metadata(0).operator String().ends_with(file_name)) {

0 commit comments

Comments
 (0)