mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Merge pull request #94002 from kitbdev/fix-goto-error
Fix goto line issues in code editor
This commit is contained in:
commit
d35bee9cdd
9 changed files with 38 additions and 45 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue