diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-03-25 00:18:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-25 00:18:04 +0100 |
commit | 5953f4d766dcd0f6ad25f223d7405bde096c18ba (patch) | |
tree | 8d71071ff413345eb12f698cad101981b9c90864 /editor | |
parent | 869fe5d3025aca41fe7ab750620e99edeffeb531 (diff) | |
parent | 2b775bd69875562afec74d2ed592ee6afcf52c26 (diff) |
Merge pull request #47329 from likeich/function_click_centered
Fix ctrl-click function line centering
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index ec931caac3..3534809891 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -601,8 +601,7 @@ void ScriptTextEditor::_bookmark_item_pressed(int p_idx) { if (p_idx < 4) { // Any item before the separator. _edit_option(bookmarks_menu->get_item_id(p_idx)); } else { - code_editor->goto_line(bookmarks_menu->get_item_metadata(p_idx)); - code_editor->get_text_editor()->call_deferred("center_viewport_to_cursor"); //Need to be deferred, because goto uses call_deferred(). + code_editor->goto_line_centered(bookmarks_menu->get_item_metadata(p_idx)); } } @@ -791,7 +790,7 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c emit_signal("request_open_script_at_line", result.script, result.location - 1); } else { emit_signal("request_save_history"); - _goto_line(result.location - 1); + goto_line_centered(result.location - 1); } } break; case ScriptLanguage::LookupResult::RESULT_CLASS: { |