(state: &mut EditorState)
| 138 | |
| 139 | pub fn set_state_scene_doc(state: &mut EditorState, doc: &SceneDoc) { |
| 140 | let next = doc.to_text(); |
| 141 | if state.doc_text != next { |
| 142 | push_scene_undo_snapshot(state); |
| 143 | state.scene_redo_stack.clear(); |
| 144 | state.doc_text = next; |
| 145 | } |
| 146 | store_scene_doc_cache(&state.doc_text, doc); |
| 147 | } |
| 148 | |
| 149 | pub fn set_state_scene_doc_loaded(state: &mut EditorState, doc: &SceneDoc) { |
| 150 | state.doc_text = doc.to_text(); |
| 151 | state.scene_undo_stack.clear(); |
| 152 | state.scene_redo_stack.clear(); |
| 153 | store_scene_doc_cache(&state.doc_text, doc); |
| 154 | } |
| 155 | |
| 156 | fn push_scene_undo_snapshot(state: &mut EditorState) { |
| 157 | if state.doc_text.is_empty() { |
| 158 | return; |
no test coverage detected