From af926854455bba29658271dee7b8d0ce7556bfaa Mon Sep 17 00:00:00 2001 From: Marius Hanl Date: Mon, 2 Sep 2024 00:28:44 +0200 Subject: [PATCH] Fix jumping to editor help does not scroll correctly sometimes --- editor/editor_help.cpp | 6 +----- editor/plugins/script_editor_plugin.cpp | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index cfe257fcfc8..baefc9b2f8b 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -2378,11 +2378,7 @@ void EditorHelp::_help_callback(const String &p_topic) { } if (class_desc->is_finished()) { - // call_deferred() is not enough. - if (class_desc->is_connected(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph))) { - class_desc->disconnect(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph)); - } - class_desc->connect(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph).bind(line), CONNECT_ONE_SHOT | CONNECT_DEFERRED); + class_desc->scroll_to_paragraph(line); } else { scroll_to = line; } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 7e0331d15c1..ad71e6d3808 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -3607,14 +3607,13 @@ void ScriptEditor::_help_class_goto(const String &p_desc) { eh->set_name(cname); tab_container->add_child(eh); + _go_to_tab(tab_container->get_tab_count() - 1); eh->go_to_help(p_desc); eh->connect("go_to_help", callable_mp(this, &ScriptEditor::_help_class_goto)); _add_recent_script(eh->get_class()); _sort_list_on_update = true; _update_script_names(); _save_layout(); - - callable_mp(this, &ScriptEditor::_help_tab_goto).call_deferred(cname, p_desc); } bool ScriptEditor::_help_tab_goto(const String &p_name, const String &p_desc) {