From 0615091b3c2f24851b77e040cc5fa97543ae4bbc Mon Sep 17 00:00:00 2001 From: Erin Date: Mon, 14 Feb 2022 00:17:55 +0100 Subject: [PATCH] added simple history support --- ablescript_cli/src/repl.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ablescript_cli/src/repl.rs b/ablescript_cli/src/repl.rs index ce1ab65..5959302 100644 --- a/ablescript_cli/src/repl.rs +++ b/ablescript_cli/src/repl.rs @@ -15,6 +15,8 @@ pub fn repl(ast_print: bool) { match rl.readline(if partial.is_some() { ">> " } else { ":: " }) { Ok(readline) => { let readline = readline.trim_end(); + rl.add_history_entry(readline); + let partial_data = match partial { Some(line) => line + &readline, None => readline.to_owned(),