From f396f70ae758ad0717f6c2ddc61e245646142833 Mon Sep 17 00:00:00 2001 From: eyelash Date: Sun, 10 May 2020 16:26:56 +0200 Subject: [PATCH] repl: fix newline in error messages --- cmd/tools/vrepl.v | 2 +- vlib/v/tests/repl/error.repl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/tools/vrepl.v b/cmd/tools/vrepl.v index df56365887..dfe968a9c3 100644 --- a/cmd/tools/vrepl.v +++ b/cmd/tools/vrepl.v @@ -148,7 +148,7 @@ fn run_repl(workdir string, vrepl_prefix string) { // but don't add this print call to the `lines` array, // so that it doesn't get called during the next print. if r.line.starts_with('print') { - source_code := r.functions.join('\n') + r.lines.join('\n') + '\n' + r.line + source_code := r.functions.join('\n') + r.lines.join('\n') + '\n' + r.line + '\n' os.write_file(file, source_code) s := os.exec('"$vexe" -repl run $file') or { rerror(err) diff --git a/vlib/v/tests/repl/error.repl b/vlib/v/tests/repl/error.repl index 92e77e442c..db674c3b6c 100644 --- a/vlib/v/tests/repl/error.repl +++ b/vlib/v/tests/repl/error.repl @@ -1,6 +1,6 @@ println(a) ===output=== -.vrepl.v:2:20: error: undefined: `a` +.vrepl.v:2:9: error: undefined: `a` 1 | 2 | println(a) - | + | ^