| 658 | } |
| 659 | |
| 660 | void ScriptEditor::_save_history() { |
| 661 | if (history_pos >= 0 && history_pos < history.size() && history[history_pos].control == tab_container->get_current_tab_control()) { |
| 662 | Node *n = tab_container->get_current_tab_control(); |
| 663 | |
| 664 | if (Object::cast_to<ScriptEditorBase>(n)) { |
| 665 | history.write[history_pos].state = Object::cast_to<ScriptEditorBase>(n)->get_navigation_state(); |
| 666 | } |
| 667 | if (Object::cast_to<EditorHelp>(n)) { |
| 668 | history.write[history_pos].state = Object::cast_to<EditorHelp>(n)->get_scroll(); |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | history.resize(history_pos + 1); |
| 673 | ScriptHistory sh; |
| 674 | sh.control = tab_container->get_current_tab_control(); |
| 675 | sh.state = Variant(); |
| 676 | |
| 677 | history.push_back(sh); |
| 678 | history_pos++; |
| 679 | |
| 680 | _update_history_arrows(); |
| 681 | } |
| 682 | |
| 683 | void ScriptEditor::_save_previous_state(Dictionary p_state) { |
| 684 | if (lock_history) { |
nothing calls this directly
no test coverage detected