You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #109522 from KoBeWi/resource_of_type_Folder
Don't open folders as file in script editor
This commit is contained in:
@@ -31,11 +31,13 @@
|
|||||||
#include "script_text_editor.h"
|
#include "script_text_editor.h"
|
||||||
|
|
||||||
#include "core/config/project_settings.h"
|
#include "core/config/project_settings.h"
|
||||||
|
#include "core/io/dir_access.h"
|
||||||
#include "core/io/json.h"
|
#include "core/io/json.h"
|
||||||
#include "core/math/expression.h"
|
#include "core/math/expression.h"
|
||||||
#include "core/os/keyboard.h"
|
#include "core/os/keyboard.h"
|
||||||
#include "editor/debugger/editor_debugger_node.h"
|
#include "editor/debugger/editor_debugger_node.h"
|
||||||
#include "editor/doc/editor_help.h"
|
#include "editor/doc/editor_help.h"
|
||||||
|
#include "editor/docks/filesystem_dock.h"
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
#include "editor/editor_string_names.h"
|
#include "editor/editor_string_names.h"
|
||||||
#include "editor/gui/editor_toaster.h"
|
#include "editor/gui/editor_toaster.h"
|
||||||
@@ -1241,7 +1243,11 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c
|
|||||||
if (ScriptServer::is_global_class(p_symbol)) {
|
if (ScriptServer::is_global_class(p_symbol)) {
|
||||||
EditorNode::get_singleton()->load_resource(ScriptServer::get_global_class_path(p_symbol));
|
EditorNode::get_singleton()->load_resource(ScriptServer::get_global_class_path(p_symbol));
|
||||||
} else if (p_symbol.is_resource_file() || p_symbol.begins_with("uid://")) {
|
} else if (p_symbol.is_resource_file() || p_symbol.begins_with("uid://")) {
|
||||||
|
if (DirAccess::dir_exists_absolute(p_symbol)) {
|
||||||
|
FileSystemDock::get_singleton()->navigate_to_path(p_symbol);
|
||||||
|
} else {
|
||||||
EditorNode::get_singleton()->load_scene_or_resource(p_symbol);
|
EditorNode::get_singleton()->load_scene_or_resource(p_symbol);
|
||||||
|
}
|
||||||
} else if (lc_error == OK) {
|
} else if (lc_error == OK) {
|
||||||
_goto_line(p_row);
|
_goto_line(p_row);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user