From 29cabb119f30f6159ba82d2cd8b1db6dcd21f4cf Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 11 May 2018 01:09:11 -0700 Subject: [PATCH] Save interpreter directives in history --- schala-repl/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/schala-repl/src/lib.rs b/schala-repl/src/lib.rs index 0d39f78..0f00267 100644 --- a/schala-repl/src/lib.rs +++ b/schala-repl/src/lib.rs @@ -237,12 +237,10 @@ impl Repl { println!("Terminal read error: {}", e); }, Ok(ref input) => { + self.console.get_history().add(input); let output = match input.chars().nth(0) { Some(ch) if ch == self.interpreter_directive_sigil => self.handle_interpreter_directive(input), - _ => { - self.console.get_history().add(input); - Some(self.input_handler(input)) - } + _ => Some(self.input_handler(input)), }; if let Some(o) = output { println!("=> {}", o);