From aae063b9ad74071437d29baa20d6ba58f0d881e4 Mon Sep 17 00:00:00 2001 From: Henrixounez Date: Sun, 18 Aug 2019 17:45:56 +0200 Subject: [PATCH] repl: dont save line if last compilation errored --- compiler/main.v | 4 +++- compiler/tests/repl/error_nosave.repl | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 compiler/tests/repl/error_nosave.repl diff --git a/compiler/main.v b/compiler/main.v index d4bff60ac0..c2cb7026ae 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -1375,7 +1375,9 @@ fn run_repl() []string { s := os.exec('$vexe run $temp_file -repl') or { panic(err) } - lines << line + if !s.exit_code { + lines << line + } vals := s.output.split('\n') for i:=0; i