MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _save_history

Method _save_history

editor/script/script_editor_plugin.cpp:660–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

658}
659
660void 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
683void ScriptEditor::_save_previous_state(Dictionary p_state) {
684 if (lock_history) {

Callers

nothing calls this directly

Calls 7

sizeMethod · 0.65
VariantClass · 0.50
get_navigation_stateMethod · 0.45
get_scrollMethod · 0.45
resizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected