You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Merge pull request #14613 from voithos/fold-jump-bugfix
Account for folded code blocks when navigating via members list
This commit is contained in:
@@ -1329,12 +1329,12 @@ void ScriptEditor::_members_overview_selected(int p_idx) {
|
|||||||
if (!se) {
|
if (!se) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Dictionary state;
|
// Go to the member's line and reset the cursor column. We can't just change scroll_position
|
||||||
state["scroll_position"] = members_overview->get_item_metadata(p_idx);
|
// directly, 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["column"] = 0;
|
||||||
state["row"] = members_overview->get_item_metadata(p_idx);
|
|
||||||
se->set_edit_state(state);
|
se->set_edit_state(state);
|
||||||
se->ensure_focus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptEditor::_help_overview_selected(int p_idx) {
|
void ScriptEditor::_help_overview_selected(int p_idx) {
|
||||||
|
|||||||
@@ -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()->cursor_set_line(state["row"]);
|
||||||
code_editor->get_text_edit()->set_v_scroll(state["scroll_position"]);
|
code_editor->get_text_edit()->set_v_scroll(state["scroll_position"]);
|
||||||
code_editor->get_text_edit()->grab_focus();
|
code_editor->get_text_edit()->grab_focus();
|
||||||
|
|
||||||
//int scroll_pos;
|
|
||||||
//int cursor_column;
|
|
||||||
//int cursor_row;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String ScriptTextEditor::get_name() {
|
String ScriptTextEditor::get_name() {
|
||||||
|
|||||||
Reference in New Issue
Block a user