Skip to content

Commit 916af46

Browse files
committed
Merge pull request #109522 from KoBeWi/resource_of_type_Folder
Don't open folders as file in script editor
2 parents cc9fcbe + a979cfd commit 916af46

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

editor/script/script_text_editor.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@
3131
#include "script_text_editor.h"
3232

3333
#include "core/config/project_settings.h"
34+
#include "core/io/dir_access.h"
3435
#include "core/io/json.h"
3536
#include "core/math/expression.h"
3637
#include "core/os/keyboard.h"
3738
#include "editor/debugger/editor_debugger_node.h"
3839
#include "editor/doc/editor_help.h"
40+
#include "editor/docks/filesystem_dock.h"
3941
#include "editor/editor_node.h"
4042
#include "editor/editor_string_names.h"
4143
#include "editor/gui/editor_toaster.h"
@@ -1241,7 +1243,11 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c
12411243
if (ScriptServer::is_global_class(p_symbol)) {
12421244
EditorNode::get_singleton()->load_resource(ScriptServer::get_global_class_path(p_symbol));
12431245
} else if (p_symbol.is_resource_file() || p_symbol.begins_with("uid://")) {
1244-
EditorNode::get_singleton()->load_scene_or_resource(p_symbol);
1246+
if (DirAccess::dir_exists_absolute(p_symbol)) {
1247+
FileSystemDock::get_singleton()->navigate_to_path(p_symbol);
1248+
} else {
1249+
EditorNode::get_singleton()->load_scene_or_resource(p_symbol);
1250+
}
12451251
} else if (lc_error == OK) {
12461252
_goto_line(p_row);
12471253

0 commit comments

Comments
 (0)