Skip to content

Commit 6e490da

Browse files
committed
Don't navigate to path when file is double-clicked
1 parent 47bc374 commit 6e490da

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

editor/filesystem_dock.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ HashSet<String> FileSystemDock::_get_valid_conversions_for_file_paths(const Vect
11911191
return all_valid_conversion_to_targets;
11921192
}
11931193

1194-
void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites) {
1194+
void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites, bool p_navigate) {
11951195
String fpath = p_path;
11961196
if (fpath.ends_with("/")) {
11971197
// Ignore a directory.
@@ -1258,7 +1258,9 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit
12581258
EditorNode::get_singleton()->load_resource(fpath);
12591259
}
12601260
}
1261-
_navigate_to_path(fpath, p_select_in_favorites);
1261+
if (p_navigate) {
1262+
_navigate_to_path(fpath, p_select_in_favorites);
1263+
}
12621264
}
12631265

12641266
void FileSystemDock::_tree_activate_file() {
@@ -1272,7 +1274,7 @@ void FileSystemDock::_tree_activate_file() {
12721274
bool collapsed = selected->is_collapsed();
12731275
selected->set_collapsed(!collapsed);
12741276
} else {
1275-
_select_file(file_path, is_favorite && !file_path.ends_with("/"));
1277+
_select_file(file_path, is_favorite && !file_path.ends_with("/"), false);
12761278
}
12771279
}
12781280
}

editor/filesystem_dock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class FileSystemDock : public VBoxContainer {
262262
void _set_file_display(bool p_active);
263263
void _fs_changed();
264264

265-
void _select_file(const String &p_path, bool p_select_in_favorites = false);
265+
void _select_file(const String &p_path, bool p_select_in_favorites = false, bool p_navigate = true);
266266
void _tree_activate_file();
267267
void _file_list_activate_file(int p_idx);
268268
void _file_multi_selected(int p_index, bool p_selected);

0 commit comments

Comments
 (0)