summaryrefslogtreecommitdiffstats
path: root/editor/plugins/script_editor_plugin.cpp
diff options
context:
space:
mode:
authorkit <kitbdev@gmail.com>2024-07-05 19:27:19 -0400
committerkit <kitbdev@gmail.com>2024-07-31 10:34:10 -0400
commit06b17a4d2f9144cd06b2b0b3b9a9cab3cac54b99 (patch)
tree20a1aa406f67d855639a71365bd1ea26fc3e4555 /editor/plugins/script_editor_plugin.cpp
parent3e0c10d3931afb62a30f26532a9f7709ee68bf2c (diff)
downloadredot-engine-06b17a4d2f9144cd06b2b0b3b9a9cab3cac54b99.tar.gz
Fix goto line issues in code editor
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
-rw-r--r--editor/plugins/script_editor_plugin.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index c51eb44aee..f19d0d7547 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -493,7 +493,7 @@ void ScriptEditor::_goto_script_line(Ref<RefCounted> p_script, int p_line) {
if (ScriptTextEditor *script_text_editor = Object::cast_to<ScriptTextEditor>(current)) {
script_text_editor->goto_line_centered(p_line);
} else if (current) {
- current->goto_line(p_line, true);
+ current->goto_line(p_line);
}
_save_history();
@@ -1857,17 +1857,13 @@ void ScriptEditor::get_breakpoints(List<String> *p_breakpoints) {
}
void ScriptEditor::_members_overview_selected(int p_idx) {
- ScriptEditorBase *se = _get_current_editor();
- if (!se) {
- return;
+ int line = members_overview->get_item_metadata(p_idx);
+ ScriptEditorBase *current = _get_current_editor();
+ if (ScriptTextEditor *script_text_editor = Object::cast_to<ScriptTextEditor>(current)) {
+ script_text_editor->goto_line_centered(line);
+ } else if (current) {
+ current->goto_line(line);
}
- // Go to the member's line and reset the cursor column. We can't change scroll_position
- // directly until we have gone to the line first, since code might be folded.
- se->goto_line(members_overview->get_item_metadata(p_idx));
- Dictionary state = se->get_edit_state();
- state["column"] = 0;
- state["scroll_position"] = members_overview->get_item_metadata(p_idx);
- se->set_edit_state(state);
}
void ScriptEditor::_help_overview_selected(int p_idx) {