summaryrefslogtreecommitdiffstats
path: root/editor/filesystem_dock.cpp
diff options
context:
space:
mode:
authorS.V.I. Vilcrow <svi@vilcrow.net>2023-10-04 21:00:23 +0300
committerS.V.I. Vilcrow <svi@vilcrow.net>2023-10-25 23:13:18 +0300
commit1ec2272e0b2cbdd662940cbe71da1c5fd96cfd33 (patch)
tree9718846501fea4513a85fb766aad8c100a68dea3 /editor/filesystem_dock.cpp
parentbfd78bb917887cfc1fd842ba23570394cad8bedb (diff)
downloadredot-engine-1ec2272e0b2cbdd662940cbe71da1c5fd96cfd33.tar.gz
Fix checking the visibility condition of selected file in the Godot editor's dock.
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r--editor/filesystem_dock.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index be06a3932c..1834b741ef 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -733,7 +733,11 @@ void FileSystemDock::_navigate_to_path(const String &p_path, bool p_select_in_fa
_update_tree(get_uncollapsed_paths(), false, p_select_in_favorites, true);
if (display_mode != DISPLAY_MODE_TREE_ONLY) {
_update_file_list(false);
- files->get_v_scroll_bar()->set_value(0);
+
+ // Reset the scroll for a directory.
+ if (p_path.ends_with("/")) {
+ files->get_v_scroll_bar()->set_value(0);
+ }
}
String file_name = p_path.get_file();
@@ -1160,9 +1164,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) {
void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites) {
String fpath = p_path;
if (fpath.ends_with("/")) {
- if (fpath != "res://") {
- fpath = fpath.substr(0, fpath.length() - 1);
- }
+ // Ignore a directory.
} else if (fpath != "Favorites") {
if (FileAccess::exists(fpath + ".import")) {
Ref<ConfigFile> config;