mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +00:00
Account for folded code blocks when navigating via members list
Previously, the editor would attempt to set the scroll position to the function's line number, but this would result in an invalid scroll whenever functions above the target were folded. This changes callback to use a combination of `goto_line` and `set_edit_state` to navigate to the target line and reset the cursor to column 0. Using `goto_line` also has the side effect of automatically unfolding the target function, which seems like useful behavior. Fixes #14572.
This commit is contained in:
parent
fb12d700c9
commit
f139d0e4e6
2 changed files with 4 additions and 8 deletions
|
@ -537,10 +537,6 @@ void ScriptTextEditor::set_edit_state(const Variant &p_state) {
|
|||
code_editor->get_text_edit()->cursor_set_line(state["row"]);
|
||||
code_editor->get_text_edit()->set_v_scroll(state["scroll_position"]);
|
||||
code_editor->get_text_edit()->grab_focus();
|
||||
|
||||
//int scroll_pos;
|
||||
//int cursor_column;
|
||||
//int cursor_row;
|
||||
}
|
||||
|
||||
String ScriptTextEditor::get_name() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue