Godot Engine – Multi-platform 2D and 3D game engine
Fix incorrect line number passed to external editor from EditorLog
Infilandf6e0a42410f0
diff --git a/editor/editor_log.cpp b/editor/editor_log.cppindex b7bb696b7c6..bfc47a7bb6b 100644--- a/editor/editor_log.cpp+++ b/editor/editor_log.cpp@@ -38,7 +38,6 @@#include "core/os/os.h"#include "core/version.h"#include "editor/docks/editor_dock.h"-#include "editor/docks/inspector_dock.h"#include "editor/editor_node.h"#include "editor/editor_string_names.h"#include "editor/script/script_editor_plugin.h"@@ -219,7 +218,11 @@ void EditorLog::_meta_clicked(const String &p_meta) {if (ResourceLoader::exists(path)) {const Ref<Resource> res = ResourceLoader::load(path);ScriptEditor::get_singleton()->edit(res, line, 0);- InspectorDock::get_singleton()->edit_resource(res);+ EditorNode *editor_node = EditorNode::get_singleton();+ if (res.is_valid() && editor_node->get_editor_selection_history()->get_current() != res->get_instance_id()) {+ // Avoid re-editing the current script without the clicked line number.+ editor_node->push_item(res.ptr(), "", true);+ }}} else if (path.has_extension("cpp") || path.has_extension("h") || path.has_extension("mm") || path.has_extension("hpp")) {// Godot source file. Try to open it in external editor.