Merge pull request #52352 from williamd67/open-help-editor-at-correct-position

This commit is contained in:
Rémi Verschelde 2021-09-15 17:56:29 +02:00 committed by GitHub
commit f77b1f4002
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,7 +117,7 @@ void EditorHelp::_class_desc_select(const String &p_select) {
} else { } else {
if (table->has(link)) { if (table->has(link)) {
// Found in the current page // Found in the current page
class_desc->scroll_to_line((*table)[link]); class_desc->scroll_to_paragraph((*table)[link]);
} else { } else {
if (topic == "class_enum") { if (topic == "class_enum") {
// Try to find the enum in @GlobalScope // Try to find the enum in @GlobalScope
@ -1345,7 +1345,7 @@ void EditorHelp::_help_callback(const String &p_topic) {
} }
} }
class_desc->call_deferred(SNAME("scroll_to_line"), line); class_desc->call_deferred(SNAME("scroll_to_paragraph"), line);
} }
static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
@ -1653,7 +1653,7 @@ Vector<Pair<String, int>> EditorHelp::get_sections() {
void EditorHelp::scroll_to_section(int p_section_index) { void EditorHelp::scroll_to_section(int p_section_index) {
int line = section_line[p_section_index].second; int line = section_line[p_section_index].second;
class_desc->scroll_to_line(line); class_desc->scroll_to_paragraph(line);
} }
void EditorHelp::popup_search() { void EditorHelp::popup_search() {