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