MCPcopy Create free account
hub / github.com/PerroEngine/Perro / undo_scene_doc

Function undo_scene_doc

perro_editor/res/scripts/editor/main.rs:157–171  ·  view source on GitHub ↗
(state: &mut EditorState)

Source from the content-addressed store, hash-verified

155 }
156}
157
158pub fn undo_scene_doc(state: &mut EditorState) -> bool {
159 let Some(prev) = state.scene_undo_stack.pop() else {
160 state.log = "undo\nempty".to_string();
161 return false;
162 };
163 if !state.doc_text.is_empty() {
164 state.scene_redo_stack.push(state.doc_text.clone());
165 }
166 state.doc_text = prev;
167 let _ = cached_scene_doc_shared(&state.doc_text);
168 state.dirty = true;
169 mark_active_scene_dirty(state);
170 state.log = format!("undo\n{} left", state.scene_undo_stack.len());
171 true
172}
173
174pub fn redo_scene_doc(state: &mut EditorState) -> bool {

Callers

nothing calls this directly

Calls 6

cached_scene_doc_sharedFunction · 0.85
mark_active_scene_dirtyFunction · 0.85
cloneMethod · 0.80
popMethod · 0.45
is_emptyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected