Add history saving
This commit is contained in:
parent
ad450469a5
commit
ae2182db5d
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
Cargo.lock
|
||||
target
|
||||
.schala_repl
|
||||
.schala_history
|
||||
|
@ -167,6 +167,8 @@ impl Repl {
|
||||
fn run(&mut self) {
|
||||
println!("MetaInterpreter v 0.05");
|
||||
|
||||
self.console.get_history().load(".schala_history").unwrap_or(());
|
||||
|
||||
loop {
|
||||
let language_name = self.languages[self.current_language_index].get_language_name();
|
||||
let prompt_str = format!("{} >> ", language_name);
|
||||
@ -187,6 +189,7 @@ impl Repl {
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
self.console.get_history().save(".schala_history").unwrap_or(());
|
||||
self.save_options();
|
||||
println!("Exiting...");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user