Skip to content

Commit

Permalink
Also fix crash for when opening in editor mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vaneri-9 committed Aug 30, 2023
1 parent 2d91836 commit ebd1d09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gui_egui/keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,18 +251,20 @@ pub fn file_open_fn(gui: &mut Gui) {
gui.path = path_buf;
}
let cs = ComponentStore::load_file(&gui.path);
gui.contexts = create_contexts(&cs.store);
let contexts = create_contexts(&cs.store);
match gui.editor_use {
true => {
if let Some(e) = gui.editor.as_mut() {
// Clear all references
reset_wire_mode(&mut e.wm);
reset_input_mode(&mut e.im);
e.components = cs.store;
e.contexts = contexts;
}
}
false => {
let simulator = Simulator::new(cs);
gui.contexts = contexts;
match simulator {
Err(e) => {
println!("couldn't open file with simulator: {}", e);
Expand Down

0 comments on commit ebd1d09

Please sign in to comment.