From 9fa6b57fe5bc0f442a59c72324c0229d388e876c 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(),